Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

See if any of the @neutrinojs/eslint defaults are unnecessary #383

Closed
edmorley opened this issue Oct 27, 2017 · 4 comments · Fixed by #1025
Closed

See if any of the @neutrinojs/eslint defaults are unnecessary #383

edmorley opened this issue Oct 27, 2017 · 4 comments · Fixed by #1025

Comments

@edmorley
Copy link
Member

neutrino-middleware-eslint sets a number of ESLint defaults:
https://github.com/mozilla-neutrino/neutrino-dev/blob/6ea0728c95ac1a7c061428a8dd7a33db7dfd6192/packages/neutrino-middleware-eslint/index.js#L59-L84

As seen in #380 and then discussed in #382, the more defaults there are, the more things people have to override/keep in sync, particularly for confusing rules like strict, whose behaviour is affected by several other settings.

Some settings we clearly do need (eg sourceType: 'module'), however I wonder if setting that makes eg impliedStrict: true redundant?

I've had a look at the ESLint docs, but it still wasn't that clear - so I suspect we'll need to do some digging in the ESLint source (followed by some tickets asking for clarification in their docs).

@eirikurn
Copy link
Contributor

eirikurn commented Nov 1, 2017

IMO emitWarning and emitError should have default values (false). When set, it forces all eslint issues to be reported as warnings and errors respectively. When both are set, emitError takes precedence, causing eslint warnings to be reported as errors and breaking the build.

The default logic is better (emitError: false, emitWarning: false). Then eslint issues are reported as warnings unless one of them is an error.

@eliperelman
Copy link
Member

Fixed emitting, evaluated settings in #493.

@edmorley
Copy link
Member Author

edmorley commented Dec 4, 2017

Reopening, since I think at least impliedStrict is unnecessary.

@edmorley edmorley reopened this Dec 4, 2017
@eliperelman
Copy link
Member

impliedStrict - enable global strict mode (if ecmaVersion is 5 or greater)

@edmorley edmorley self-assigned this Aug 15, 2018
@edmorley edmorley changed the title See if any of the neutrino-middleware-eslint defaults are unnecessary See if any of the @neutrinojs/eslint defaults are unnecessary Aug 15, 2018
edmorley added a commit that referenced this issue Aug 19, 2018
* Updates all dependencies to the latest available to pick up any
  ESLint 5 compatibility fixes (in the case of `babel-eslint` and
  `eslint-plugin-vue` this meant beta versions, so for those the
  tilde range has been changed to exact, pending the final versions).
* Raises `ecmaVersion` to `2018`.
* Removes all custom `ecmaFeatures` options since:
  - `impliedStrict` is redundant when using `sourceType: 'module'`
  - none of the others are recognised by latest ESLint/`babel-eslint`

Migration guide:
https://eslint.org/docs/user-guide/migrating-to-5.0.0

Docs to help with reviewing the `parserOptions` changes:
https://eslint.org/docs/user-guide/configuring#specifying-parser-options
https://github.com/babel/babel-eslint#configuration
https://eslint.org/docs/rules/strict#rule-details (for `impliedStrict`)

Fixes #383.
Closes #963.
Closes #1001.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

3 participants