-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support Eslint 7 & add rules #15
Changes from 17 commits
abd5b3d
e0e33d4
d44cec5
0ada918
90568b4
2f3fa09
3d4e63b
81e002a
eb56be7
5ba8acb
de32f93
cc03c02
1ed29e2
108abf0
cd4f9af
12689b6
3f4c2c1
d353749
3c7c575
a46b862
2206a9b
405fcae
a223833
2424c1c
fb718af
2427366
833c392
cd6f942
cc49768
eeb2040
ef3bf96
1e102c1
70bdcdd
00b2789
8f4b52c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"extends": "./base.js" | ||
"extends": "./script.js" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
node_modules/ | ||
|
||
yarn.lock | ||
.npmrc |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,32 +3,34 @@ | |
## Changes | ||
|
||
- **[Breaking]**: upgrade `eslint-plugin-react-hooks` to `^4.0.2` | ||
- **[Breaking]**: upgrade `eslint-plugin-flowtype` to `^5.1.0` | ||
- upgrade `eslint-plugin-react` to `^7.20.0` | ||
- **[Breaking]**: upgrade `eslint-plugin-flowtype` to `^5.2.0` | ||
- **[Breaking]**: remove `eslint-plugin-ramda` to `^5.1.0` | ||
- **[Breaking]**: minimum supported NodeJs version 12.18 | ||
- upgrade `babel-eslint` to `^10.1.0` | ||
- upgrade `eslint-plugin-eslint-comments` to `^3.2.0` | ||
- upgrade `eslint-plugin-import` to `^2.22.0` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
- upgrade `eslint-plugin-jsx-a11y` to `^6.3.1` | ||
- upgrade `eslint-plugin-react` to `^7.21.2` | ||
- upgrade `eslint-plugin-react-hooks` to `^4.1.2` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
- Fix dependency list in README | ||
|
||
## Likely to cause new errors | ||
|
||
- `require-atomic-updates` | ||
- `no-undefined` | ||
- `array-bracket-newline` | ||
- `func-names`: is now reported as error instead of warning | ||
- `func-style` | ||
- `lines-around-directive`: removed & replaced by `padding-line-between-statements` | ||
- `no-multiple-empty-lines`: `{ max: 1, maxBOF: 0, maxEOF: 0 }` | ||
- `no-restricted-syntax`: allow `for..of` usage | ||
- `sort-keys` | ||
- `flowtype/require-compound-type-alias`: `always` | ||
- `flowtype/require-readonly-react-props` | ||
- `flowtype/require-types-at-top` | ||
- `flowtype/type-import-style`: `identifier` | ||
- `flowtype/no-existential-type` | ||
- `import/no-namespace` | ||
- `import/order`: add `alphabetize: { order: 'asc' 'caseInsensitive': true }` & change `groups` to the following - `order: `builtin`, `external`, `internal`, `parent`, `sibling` | ||
- `import/no-unassigned-import` | ||
- `import/no-anonymous-default-export`: for functions & classes | ||
- `import/exports-last` | ||
- `import/group-exports` | ||
- `import/no-unused-modules` | ||
- `react/function-component-definition` | ||
- `react/jsx-key` | ||
- `react/no-direct-mutation-state` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,40 +15,35 @@ module.exports = { | |
'flowtype/delimiter-dangle': ['error', 'always-multiline', 'always-multiline', 'always-multiline'], | ||
'flowtype/generic-spacing': ['error', 'never'], | ||
'flowtype/newline-after-flow-annotation': ['error', 'always'], | ||
'flowtype/no-mixed': 'off', | ||
'flowtype/no-dupe-keys': 'error', | ||
// TODO: enable? | ||
'flowtype/no-existential-type': 'off', | ||
'flowtype/no-existential-type': 'error', | ||
'flowtype/no-flow-fix-me-comments': 'off', | ||
'flowtype/no-mixed': 'off', | ||
// TODO: enable? | ||
'flowtype/no-mutable-array': 'off', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if it forces us to only use https://github.com/gajus/eslint-plugin-flowtype/blob/master/.README/rules/no-mutable-array.md There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have this
And also we will still be able to do perf optimisations using |
||
'flowtype/no-primitive-constructor-types': 'error', | ||
'flowtype/no-types-missing-file-annotation': 'error', | ||
'flowtype/no-unused-expressions': 'error', | ||
// TODO: disable any? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
'flowtype/no-weak-types': ['error', { any: false }], | ||
'flowtype/object-type-delimiter': ['error', 'comma'], | ||
'flowtype/require-compound-type-alias': ['error', 'always'], | ||
'flowtype/require-compound-type-alias': ['off', 'always'], | ||
'flowtype/require-exact-type': 'off', | ||
'flowtype/require-indexer-name': 'off', | ||
'flowtype/require-inexact-type': 'off', | ||
'flowtype/require-parameter-type': 'off', | ||
'flowtype/require-readonly-react-props': 'error', | ||
'flowtype/require-return-type': 'off', | ||
'flowtype/require-types-at-top': 'error', | ||
'flowtype/require-types-at-top': 'off', | ||
'flowtype/require-valid-file-annotation': 'off', | ||
'flowtype/require-variable-type': 'off', | ||
'flowtype/semi': ['error', 'always'], | ||
'flowtype/sort-keys': ['error', 'asc', { caseSensitive: false, natural: true }], | ||
'flowtype/sort-keys': ['error', 'asc'], | ||
'flowtype/space-after-type-colon': ['error', 'always'], | ||
'flowtype/space-before-generic-bracket': ['error', 'never'], | ||
'flowtype/space-before-type-colon': ['error', 'never'], | ||
// TODO: enable? | ||
'flowtype/spread-exact-type': 'off', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's because spreading non-exact type is not safe and not properly supported by flow There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be possible to enable 🤔 |
||
'flowtype/type-id-match': 'off', | ||
// Use identifier as declaration imports are not well supported by vscode | ||
'flowtype/type-import-style': ['error', 'identifier'], | ||
'flowtype/type-import-style': ['off', 'declaration'], | ||
'flowtype/union-intersection-spacing': ['error', 'always'], | ||
'flowtype/use-flow-type': 'warn', | ||
}, | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing breaking changes
eslint
to^7.10.0
.