-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
upgrades eslint v5 (major), babel-eslint, eslint-plugin-flowtype, eslint-plugin-prettier #8259
Conversation
…pe (minor), eslint-plugin-prettier (patch)
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/8489/ |
@@ -47,10 +47,10 @@ flow: | |||
./node_modules/.bin/flow check --strip-root | |||
|
|||
lint: | |||
./node_modules/.bin/eslint scripts $(SOURCES) '*.js' '**/.*.js' --format=codeframe --rulesdir="./scripts/eslint_rules" |
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.
Why where these removed? I think that it was used to lint things like babel.config.js
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 tried to explain it above:
- removed non-existing glob: '**/.*.js' https://eslint.org/docs/5.0.0/user-guide/migrating-to-5.0.0#-linting-nonexistent-files-from-the-command-line-is-now-a-fatal-error
- in addition removed default file .js extension glob: '*.js'
babel.config.js seems to fall through the crack though, let me check ...
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 don't get why it is non-existing, it should just match everything... I guess I will download this PR and test it
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.
oh I see. just looking at it a little closer: '**/.*.js'
I suppose there are no files with . (dot)something.js anymore. the (old?) babel.config.js probably started with a dot prior.
eslint v5 doesn't find anything starting with . (dot), and throws.
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 think we could take out $(SOURCES)
, and replace it with '**/*.js'
(everything), and .eslintignore
excludes everything which needs to be excluded. that runs just fine, and includes babel.config.js as well.
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.
Oh, i didn't notice the .
in .*.js
. It is ok to have sources instead of **/*.js
(we would lint too much otherwise), but *.js
should still be there. I tested it locally ant with this patch babel.config.js
isn't linted anymore.
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 didn't really see it either 😃 I only saw eslint complaining, and removed it.
alrighty, I'll put '*.js'
back shortly and leave $(SOURCES) as is.
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.
Thank you!
…int-plugin-prettier (babel#8259) * upgrade eslint v5 (major), babel-eslint (minor), eslint-plugin-flowtype (minor), eslint-plugin-prettier (patch) * fix makefile: remove (default) .js file extension, remove non-existing glob pattern * fix linting errors * add '*.js' glob back to include babel.config.js for linting
make lint
andmake fix
passmigration guide:
https://eslint.org/docs/5.0.0/user-guide/migrating-to-5.0.0
breaking change, v5 throws for non-existing files:`
https://eslint.org/docs/5.0.0/user-guide/migrating-to-5.0.0#-linting-nonexistent-files-from-the-command-line-is-now-a-fatal-error
-> removed non-existing glob, in addition removed default file .js extension glob
breaking change, v5 no-unused-vars reports all after-used params
https://eslint.org/blog/2018/04/eslint-v5.0.0-alpha.1-released#breaking-changes
-> added // eslint-disable-line no-unused-vars