-
Notifications
You must be signed in to change notification settings - Fork 282
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
Fixes #990 — Bring linting up to date #991
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This takes us from 3.1.1 to 5.12.1.
To keep our practices in sync across the projects. Note that I am keeping it as a JS file because I want Prettier to keep it well formatted. (Prettier can also format JSON, but I don't think it knows that ".eslintrc" is JSON unless you provide additional configuration.)
Because it is required by the config that we synched over from Clay.
Once I've actually fixed all the lints I will add the "lint" task to our "prepublishOnly" task as well.
[ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in ".eslintrc.js") The Object Rest/Spread proposal: https://github.com/tc39/proposal-object-rest-spread hit Stage 4 (ie. finished) in ES 2018: http://2ality.com/2017/02/ecmascript-2018.html so swap out "ecmaFeatures.experimentalObjectRestSpread: true" for "ecmaVersion: 2018" instead.
This turns off any ESLint rules that might conflict with Prettier (things like indents, quotes etc). With this plugin configured, you can (in theory*) run things one after another without clobbering things: ``` npm run fix # fixes fixable lints, but not formatting issues npm run format # fixes formatting issues npm run fix # won't make any changes ``` (* Only in theory, because it looks like there are still a couple of extra rules that I'll need to manually tweak.)
Note that despite the use of the eslint-config-prettier, the actual sequence here is: npm run fix npm run format Because while the config stops ESLint from complaining about things that Prettier will take care of, ESLint isn't always capable of producing the right indent from Prettier's point of view. Before: ✖ 1480 problems (1480 errors, 0 warnings) After: ✖ 704 problems (704 errors, 0 warnings) I'll continue to look at the ones that can't be autofixed.
Also created #994 which is basically identical to this one but with two more commits applied on top (addressing the fact that we weren't linting/formatting JSX files — whoops!). I created a separate PR because I don't want to touch this one now that it is green. |
julien
approved these changes
Jan 24, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.