Skip to content
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

ESLint config clean up #1093

Merged
merged 3 commits into from
Dec 2, 2017
Merged

ESLint config clean up #1093

merged 3 commits into from
Dec 2, 2017

Conversation

exarus
Copy link
Contributor

@exarus exarus commented Nov 21, 2017

I've checked the .eslintrc.js configuration and found 2 ways to make it even better.

1. Remove unnecessary quotes from fields

Since we're using .js config we are already abusing JS object literal brevity in other fields. Unquoting these fields brings consistency to ESLint config.

2. Use more explicit ESLint rule settings

Some users of the template are not experts in ESLint configuration. So they might want to dig in and check what's under the hood. I think that using explicit 'error' 'warn' and 'off' should be preferred over 2, 1 and 0 in this template. These values are taken from ESLint configuration guide.

3. Remove redundand 'arrow-parens': 'off'

Also it was weird to find 'arrow-parens': 'off' in ESLint config (when Standard JS option was selected during project initialization). Standard JS don't specify this rule, so the line has no effect. I think that this line should affect other supported code styles. So I think that we should exclude 'arrow-parens': 'off' if Standard JS was selected as code style option.

Additional suggestions

While checking the ESLint config I've found that it was desided to disable Standard JS 'generator-star-spacing'. I wounder why does non-standard code style is encouraged. I think that it's legacy from older Standard JS versions or some other code style. I suggest to remove the line that disables 'generator-star-spacing' for Standard JS.

Since we're using .js config we are already abusing JS object literal brevity in other fields. Unquoting these fields brings consistency to ESLint config.
@exarus exarus changed the title Remove unnecessary quotes from .eslintrc.js Clean up .eslintrc.js Nov 21, 2017
@exarus exarus changed the title Clean up .eslintrc.js ESLint config clean up Nov 21, 2017
Remove ESLint 'arrow-parens' rule for StandardJS. StandardJS don't define this rule. So it's redundant to specify it's ignorance explicitly.
@LinusBorg LinusBorg merged commit 5ac6d62 into vuejs-templates:develop Dec 2, 2017
@LinusBorg
Copy link
Contributor

Thanks

LinusBorg added a commit that referenced this pull request Dec 2, 2017
* develop:
  bump version 1.2.5
  some small updates to the docs
  Adds support for the video poster attribute (#1123)
  babel-register use only for e2e tests (#1120)
  Update project creation: sort dependencies in package.json (#1118)
  Fix bug from PR #1082
  FIX: convert env variable PORT to a number.
  Minor refactoring of build scripts (#1082)
  ESLint config clean up (#1093)
  Switch to uglifyjs-webpack-plugin (#1119)
  change bad spaces into normal spaces and removing trailing space (#1132)
  prevent empty line when unit = y & e2e = n
  Update meta.js (#1091)
  docs(README): Update usage to init from develop branch (#1092)
  Use actual host for notification (#1101). (#1103)
  prevent webpack from injecting useless mocks
frandiox pushed a commit to OnsenUI/vue-cordova-webpack that referenced this pull request Dec 25, 2017
* Remove unnecessary quotes from .eslintrc.js

Since we're using .js config we are already abusing JS object literal brevity in other fields. Unquoting these fields brings consistency to ESLint config.

* ESLint config is more explicit

* Remove redundant rule for ESLint Standard JS
Remove ESLint 'arrow-parens' rule for StandardJS. StandardJS don't define this rule. So it's redundant to specify it's ignorance explicitly.
shenron pushed a commit to shenron/webpack that referenced this pull request Mar 20, 2018
* Remove unnecessary quotes from .eslintrc.js

Since we're using .js config we are already abusing JS object literal brevity in other fields. Unquoting these fields brings consistency to ESLint config.

* ESLint config is more explicit

* Remove redundant rule for ESLint Standard JS
Remove ESLint 'arrow-parens' rule for StandardJS. StandardJS don't define this rule. So it's redundant to specify it's ignorance explicitly.
shenron pushed a commit to shenron/webpack that referenced this pull request Mar 20, 2018
* develop:
  bump version 1.2.5
  some small updates to the docs
  Adds support for the video poster attribute (vuejs-templates#1123)
  babel-register use only for e2e tests (vuejs-templates#1120)
  Update project creation: sort dependencies in package.json (vuejs-templates#1118)
  Fix bug from PR vuejs-templates#1082
  FIX: convert env variable PORT to a number.
  Minor refactoring of build scripts (vuejs-templates#1082)
  ESLint config clean up (vuejs-templates#1093)
  Switch to uglifyjs-webpack-plugin (vuejs-templates#1119)
  change bad spaces into normal spaces and removing trailing space (vuejs-templates#1132)
  prevent empty line when unit = y & e2e = n
  Update meta.js (vuejs-templates#1091)
  docs(README): Update usage to init from develop branch (vuejs-templates#1092)
  Use actual host for notification (vuejs-templates#1101). (vuejs-templates#1103)
  prevent webpack from injecting useless mocks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants