This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 214
Monorepo linting improvements #949
Merged
edmorley
merged 7 commits into
neutrinojs:master
from
edmorley:monorepo-linting-improvements
Jun 13, 2018
Merged
Monorepo linting improvements #949
edmorley
merged 7 commits into
neutrinojs:master
from
edmorley:monorepo-linting-improvements
Jun 13, 2018
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
Since `include` is only used by `eslint-loader`, and all linting for this monorepo occurs via the ESLint CLI, bypassing it.
This also means the `.eslintignore` entry for `.neutrinorc.js` can be removed, since ESLint doesn't ignore dotfiles specified via globs. The `lint` script's glob has to be double quoted and escaped, to ensure it works correctly on Windows.
The `vue` dependency was added to fix: `Unable to resolve path to module 'vue' import/no-unresolved` ...but will also have the benefit of meaning we get a Renovate PR when it's time to update the pinned version of Vue in create-project's version matrix.
Files with extension `.jsx` are now linted, which gives coverage of the various JSX create-project template files. (Doing the same for `.vue` turned out to be much more of a pain, since it requires a different parser/plugin/rules than the ones used by the AirBnb preset - so not bothering for now.)
eliperelman
approved these changes
Jun 13, 2018
acconrad
pushed a commit
to acconrad/neutrino-dev
that referenced
this pull request
Jul 13, 2018
* Reduce number of airbnb-base rules that are globally disabled * Remove redundant lint `include` from .neutrinorc.js Since `include` is only used by `eslint-loader`, and all linting for this monorepo occurs via the ESLint CLI, bypassing it. * Lint repo root .eslintrc.js too (and any other future dotfiles) This also means the `.eslintignore` entry for `.neutrinorc.js` can be removed, since ESLint doesn't ignore dotfiles specified via globs. The `lint` script's glob has to be double quoted and escaped, to ensure it works correctly on Windows. * Lint tests too * Lint the create-projects templates directory too The `vue` dependency was added to fix: `Unable to resolve path to module 'vue' import/no-unresolved` ...but will also have the benefit of meaning we get a Renovate PR when it's time to update the pinned version of Vue in create-project's version matrix. * Lint JSX too Files with extension `.jsx` are now linted, which gives coverage of the various JSX create-project template files. (Doing the same for `.vue` turned out to be much more of a pain, since it requires a different parser/plugin/rules than the ones used by the AirBnb preset - so not bothering for now.) * Use --report-unused-disable-directives
This was referenced Jun 9, 2019
edmorley
added a commit
that referenced
this pull request
Jun 20, 2019
…1413) For React components projects, it's expected that they will not have a direct dependency on React/React DOM/prop-types, but instead have them as peer dependencies. However until now, create-project has not actually configured them in `peerDependencies` correctly, which causes false positive ESLint errors from the `import/no-extraneous-dependencies` rule. These false positives were previously wallpapered over using `eslint-disable`, however that workaround was regressed in #949, and wasn't the correct fix. This wasn't caught in CI, since we did not test the combination of react-components with AirBnB, only with StandardJS. Note: `eslint-plugin-imports` cache handling is fragile, so existing projects that have `peerDependencies` manually added will require the cache (`.eslintcache`) to be removed for the changes to be detected. Fixes #1388.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
include
from.neutrinorc.js
..eslintrc.js
to the list of monorepo files being linted.--report-unused-disable-directives
.See individual commits for more details.
At some point after this PR we should also deal with the pre-existing issue of having the style AirBnB rules disabled (due to the
extends: ['prettier']
), but yet we don't actually have Prettier enabled to replace them. However doing so causes a lot more diff churn / need for discussion, so I've left that out of this PR.