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

Scripts: Add missing root flag to the default Eslint config #13483

Merged
merged 2 commits into from Jan 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/scripts/CHANGELOG.md
Expand Up @@ -5,6 +5,10 @@
- Added support for `build` script ([#12837](https://github.com/WordPress/gutenberg/pull/12837))
- Added support for `start` script ([#12837](https://github.com/WordPress/gutenberg/pull/12837))

### Bug Fix

- Avoid inheriting from ESLint configurations in ancestor directories when using the default configuration ([#13483](https://github.com/WordPress/gutenberg/pull/13483))

## 2.5.0 (2019-01-09)

### New Features
Expand Down
1 change: 1 addition & 0 deletions packages/scripts/config/.eslintrc.js
@@ -1,3 +1,4 @@
module.exports = {
root: true,
extends: [ 'plugin:@wordpress/eslint-plugin/recommended' ],
};
5 changes: 4 additions & 1 deletion packages/scripts/scripts/lint-js.js
Expand Up @@ -26,8 +26,11 @@ const hasLintConfig = hasCliArg( '-c' ) ||
hasProjectFile( '.eslintrc' ) ||
hasPackageProp( 'eslintConfig' );

// When a configuration is not provided by the project, use from the default
// provided with the scripts module. Instruct ESLint to avoid discovering via
// the `--no-eslintrc` flag, as otherwise it will still merge with inherited.
const config = ! hasLintConfig ?
[ '--config', fromConfigRoot( '.eslintrc.js' ) ] :
[ '--no-eslintrc', '--config', fromConfigRoot( '.eslintrc.js' ) ] :
[];

const result = spawn(
Expand Down