-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix: Bumped eslint, prettier-eslint to latest with updates #97
Conversation
Bumped eslint to 4.5.0 and prettier-eslint to 6.4.2. Updated eslint-config-kentcdodds to 12.4.2. Added some changes to package.json to correct new formatting of error rules form eslint. Imported Config and Lint from eslint/lib to pass into the new ConfigFile.load(file, context) BREAKING CHANGE: Updating to eslint latest is a breaking change as we need to pass context into the .load function fix: update to eslint 4.0 prettier#94
Codecov Report
@@ Coverage Diff @@
## master #97 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 3 3
Lines 107 108 +1
=====================================
+ Hits 107 108 +1
Continue to review full report at Codecov.
|
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 so much for working on this! Just a few questions 😄
], | ||
"object-curly-spacing": [ | ||
"error", | ||
"never" |
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.
Are these changes necessary?
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.
The tests do not pass without these changes. I took a look at the config repo and did not see the cases for this. Therefore when the npm start validate
ran the files were handled according to the rules but two failed to occur. The removal of a ;
and the spacing around an object import { something } from 'something
vs import {something} from 'something'
. The test required tha latter to pass.
src/format-files.js
Outdated
if (eslintConfigPath) { | ||
prettierESLintOptions.eslintConfig = ConfigFile.load(eslintConfigPath) | ||
prettierESLintOptions.eslintConfig = | ||
ConfigFile.load(eslintConfigPath, configContext) |
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.
There's nothing that's changing about the external API right? So this is technically not a breaking change I think.
src/format-files.js
Outdated
@@ -49,9 +51,10 @@ function formatFilesFromArgv({ | |||
prettierLast, | |||
prettierOptions, | |||
} | |||
|
|||
const configContext = new Config({}, new Linter()) |
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.
Also, it looks like configContext
is only used within the if
statement below, could we move this declaration to within that if
statement?
Updates after PR Review to move const location BREAKING CHANGE: None prettier#94
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.
Thanks a bunch!
Bumped eslint to 4.5.0 and prettier-eslint to 6.4.2. Updated eslint-config-kentcdodds to 12.4.2.
Added some changes to package.json to correct new formatting of error rules form eslint. Imported
Config and Lint from eslint/lib to pass into the new ConfigFile.load(file, context)
fix: update to eslint 4.0 #94
What:
Bumped eslint to 4.5.0 and prettier-eslint to 6.4.2. Updated eslint-config-kentcdodds to 12.4.2. Added some changes to package.json to correct new formatting of error rules form eslint. Imported Config and Lint from eslint/lib to pass into the new ConfigFile.load(file, context)
Why:
Want to get prettier-eslint-cli to the latest version of eslint and prettier-eslint
How:
Updated packages. Added some additional logic to load method for loading config. Updated eslint rules to include new eslint standards for semi and object curly braces.