-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
chore: Upgrade ESLint and all plugis & revalidate the config and ALL of the rules #15287
base: develop
Are you sure you want to change the base?
Conversation
🚀 Expo preview is ready!
|
@@ -0,0 +1,3 @@ | |||
import { eslint } from '@trezor/eslint'; | |||
|
|||
export default [...eslint]; |
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.
Repository top-level config is now lust a link into package that contains all of the configuration.
@@ -31,7 +31,7 @@ | |||
"type-check": "yarn nx run-many --target=type-check", | |||
"type-check:force": "rimraf -rf -- **/libDev && yarn type-check", | |||
"test:unit": "yarn nx run-many --target=test:unit", | |||
"lint:js": "eslint . --cache --cache-strategy content --ignore-path .gitignore", | |||
"lint:js": "eslint . --cache --cache-strategy content --flag unstable_config_lookup_from_file", |
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.
This flag loads configuration which is closest to the checked file. This enables the overriding of the rules per package.
b0935ec
to
7717018
Compare
1a396a1
to
c07ea17
Compare
@@ -14,18 +22,12 @@ module.exports = { | |||
name: getAbsolutePath('@storybook/react-webpack5'), | |||
options: {}, | |||
}, | |||
babel: async options => { |
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.
I have tested the build of storybook and it works.
@@ -14,18 +22,12 @@ module.exports = { | |||
name: getAbsolutePath('@storybook/react-webpack5'), | |||
options: {}, | |||
}, | |||
babel: async options => { |
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.
Tested the build of story book and it works.
@@ -2,7 +2,6 @@ const { ...baseConfig } = require('../../jest.config.base'); | |||
|
|||
module.exports = { | |||
...baseConfig, | |||
testEnvironment: 'node', |
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.
duplicate key
694c6c9
to
fb7a053
Compare
fb7a053
to
92bc152
Compare
@@ -9,15 +9,13 @@ const Wrapper = styled.div` | |||
flex-direction: column; | |||
`; | |||
|
|||
// eslint-disable-next-line local-rules/no-override-ds-component |
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.
When overwrite happens inside the @trezor/components
it wont get reported. And now the ESLint complains about unused ignore. It is here multiple times.
@@ -7,7 +7,6 @@ const Floating = styled.div` | |||
margin-top: -2rem; | |||
`; | |||
|
|||
// eslint-disable-next-line local-rules/no-override-ds-component |
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.
Incorrect Link
is from 'next/link'
and not from @trezor/components
. Now ESLint correctly raised error that this is unused ignore.
@@ -86,7 +86,6 @@ const Step = styled.div<{ $isActive: boolean }>` | |||
`} | |||
`; | |||
|
|||
// eslint-disable-next-line local-rules/no-override-ds-component |
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.
This is override inside of the @trezor/produce-components
this wont be reported by the rule and therefore it is unused ignore.
@@ -1,3 +1,4 @@ | |||
// eslint-disable-next-line import/no-extraneous-dependencies | |||
import * as Codegen from '@sinclair/typebox-codegen/typescript'; |
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.
@martykan I am not sure how to solve this. Please take a look.
d5cbbd0
to
97d82f1
Compare
97d82f1
to
79c88a2
Compare
This is PR that upgrades the ESLint and all its plugins + does refactoring of the whole configuration.
@trezor/eslint
but its used globally.package.json
and then they can define their own config.no-shadow
rule, as it start reporting insane amount of stuff and it was hard to configure. I think we can solve it separately in future PR.I have written a bunch of comments in the PR itself to explain stuff. I hope it help you to do code-review.
Performance:
Outcome of the
reset && find . -type f -name ".eslintcache" -delete && time TIMING=1 yarn lint:js
This PR:
develop
I assume the much longer run is due to many more rules and files are being checked as I removed many of the
offs
we had and enabled many of the checks for most of the packages. Also I suppose withrecommended
settings some of the rules were added on top of what we have.