Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update config and dependencies #8

Merged
merged 1 commit into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 3 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,9 @@ branches:

cache: yarn

stages:
- name: pull_request
if: branch != master
- name: release
if: branch = master AND type = push

jobs:
include:
- stage: pull_request
script: yarn run lint
- stage: release
script:
- yarn run lint
- yarn run semantic-release
script:
- yarn lint
- yarn semantic-release

notifications:
email: false
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ESLint configuration for [Typeform](https://github.com/Typeform/) front-end proj
## Install

```sh
yarn add eslint babel-eslint @typeform/eslint-config --dev
yarn add eslint @babel/eslint-parser @typeform/eslint-config --dev
```

## Usage
Expand All @@ -15,7 +15,7 @@ If you want to use the default configuration, you can simply create a `.eslintrc
```js
module.exports = {
extends: ['@typeform/eslint-config'],
}
};
```

And run with:
Expand Down
118 changes: 0 additions & 118 deletions accessibility/lint-rules.js

This file was deleted.

89 changes: 20 additions & 69 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,94 +1,45 @@
const a11yLintRules = require('./accessibility/lint-rules')
const performanceRules = require('./performance/lint-rules')

module.exports = {
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
extends: [
'standard',
'standard-jsx',
'plugin:react/recommended',
'react-app',
'plugin:jsx-a11y/recommended',
'prettier',
'prettier/@typescript-eslint',
'prettier/babel',
'prettier/react',
'prettier/standard',
],
plugins: [
'filenames',
'jsx-a11y',
'react',
'react-perf',
'react-hooks',
'jest',
],
settings: {
react: {
version: '16',
},
},
plugins: ['jest'],
env: {
browser: true,
commonjs: true,
es6: true,
jest: true,
node: true,
'browser': true,
'commonjs': true,
'es6': true,
'jest': true,
'node': true,
'jest/globals': true,
},
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
generators: true,
},
},
rules: Object.assign({}, a11yLintRules, performanceRules, {
'react/jsx-no-target-blank': 'warn',
'react/no-danger': 'warn',
'react/jsx-sort-props': 'warn',
'react/jsx-handler-names': 'warn',
'react/jsx-no-bind': 'warn',
'react/sort-comp': [
'warn',
{
order: [
'static-methods',
'instance-variables',
'lifecycle',
'/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/',
'everything-else',
'/^render.+$/',
'render',
],
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
},
],
rules: {
'import/order': [
'warn',
{
'newlines-between': 'always',
},
],
'import/export': 'warn',
'filenames/match-regex': ['warn', '^_?[a-z0-9-.]+$'],
'jest/no-focused-tests': 'error',
'comma-dangle': ['error', 'always-multiline'],
complexity: ['warn', { max: 7 }],
'consistent-return': 'warn',
'global-require': 'warn',
'no-console': 'warn',
'no-else-return': 'warn',
'no-nested-ternary': 'warn',
'no-shadow': 'warn',
'no-unneeded-ternary': 'warn',
'object-shorthand': 'warn',
'prefer-const': 'warn',
'prefer-template': 'warn',
}),
}
},
settings: {
react: {
version: 'detect',
},
},
};
65 changes: 44 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
"description": "ESLint configuration for Typeform front-end projects",
"main": "index.js",
"repository": "git@github.com:Typeform/eslint-config-typeform.git",
"license": "LGPL 3.0",
"license": "LGPL-3.0-only",
"private": false,
"engines": {
"node": ">=10"
},
"scripts": {
"test": "echo 'no tests' && exit 0",
"eslint": "eslint -c ./index.js",
Expand All @@ -27,33 +30,52 @@
"access": "public"
},
"dependencies": {
"eslint-config-prettier": "^3.1.0",
"eslint-config-standard": "^12.0.0",
"eslint-config-standard-jsx": "^6.0.2",
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.1.0",
"eslint-config-prettier": "^6.11.0",
"eslint-config-react-app": "^5.2.1",
"eslint-config-standard": "^14.1.1",
"eslint-config-standard-jsx": "^8.1.0",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^22.6.4",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-react-hooks": "^1.6.0",
"eslint-plugin-react-perf": "^2.0.9",
"eslint-plugin-standard": "^4.0.0"
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^24.0.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.0",
"eslint-plugin-standard": "^4.0.1"
},
"peerDependencies": {
"babel-eslint": "^10.0.1",
"eslint": "^5.8.0"
"@babel/core": "7.x",
"@babel/eslint-parser": "7.x",
"eslint": "7.x"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/eslint-parser": "^7.11.5",
"@semantic-release/exec": "^5.0.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"husky": "^1.3.1",
"lint-staged": "^8.1.0",
"semantic-release": "^17.0.7"
"eslint": "^7.8.1",
"husky": "^4.3.0",
"lint-staged": "^10.3.0",
"semantic-release": "^17.1.1"
},
"release": {
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"master",
"next",
"next-major",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
Expand All @@ -66,5 +88,6 @@
}
]
]
}
},
"babel": {}
}
9 changes: 0 additions & 9 deletions performance/lint-rules.js

This file was deleted.