-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: Improve recommended settings included in the package #17027
Changes from all commits
3c616fc
35b412f
7e186e4
8a8c320
1bfc971
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"overrides": [ | ||
{ | ||
"files": [ "shared-tests.js" ], | ||
"extends": [ | ||
"plugin:@wordpress/eslint-plugin/test-unit" | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,18 @@ | |
|
||
- The [`@wordpress/no-unused-vars-before-return` rule](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars-before-return.md) has been improved to exempt object destructuring only if destructuring to more than one property. | ||
- Stricter JSDoc linting using [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc). | ||
- Stricter validation enabled for test files only using new `test-e2e` and `test-unit` rulesets. | ||
|
||
### New Features | ||
|
||
- New Rule: [`@wordpress/no-unguarded-get-range-at`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/no-unguarded-get-range-at.md) | ||
- Enable `wp` global by default in the `recommended` config. | ||
- New ruleset `test-e2e` added for end-to-end tests validation. | ||
- New ruleset `test-unit` added for unit tests validation. | ||
|
||
### Enhancements | ||
|
||
- Remove `@wordpress/dependency-group` and `@wordpress/gutenberg-phase` rules from the `custom` and `recommended` configs and leave them as opt-in features. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 This is mostly a breaking change for consumers that are using these rules. Most consumers won't want/need them so I like. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think it should be highlighted as breaking change? I wasn’t sure where to put it. Given that, there are other breaking changes, we can more freely move it if necessary 😃 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure either. The scope of when it's considered a breaking change is fairly narrow and it's only breaking in the sense the rules won't be applied automatically anymore. |
||
|
||
## 2.4.0 (2019-08-05) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,26 @@ module.exports = { | |
document: true, | ||
wp: 'readonly', | ||
}, | ||
overrides: [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ntwb, I was referring to this changes in #17061 (comment). I linked wrong PR 😃 |
||
{ | ||
// Unit test files and their helpers only. | ||
files: [ | ||
'**/@(test|__tests__)/**/*.js', | ||
'**/?(*.)test.js', | ||
], | ||
extends: [ | ||
require.resolve( './test-unit.js' ), | ||
], | ||
}, | ||
{ | ||
// End-to-end test files and their helpers only. | ||
files: [ | ||
'**/specs/**/*.js', | ||
'**/?(*.)spec.js', | ||
], | ||
extends: [ | ||
require.resolve( './test-e2e.js' ), | ||
], | ||
}, | ||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
extends: [ | ||
'plugin:jest/recommended', | ||
], | ||
env: { | ||
browser: true, | ||
}, | ||
globals: { | ||
browser: 'readonly', | ||
page: 'readonly', | ||
wp: 'readonly', | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
extends: [ | ||
'plugin:jest/recommended', | ||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
{ | ||
"root": true, | ||
"extends": "plugin:@wordpress/eslint-plugin/es5", | ||
"extends": [ | ||
"plugin:@wordpress/eslint-plugin/es5" | ||
], | ||
"env": { | ||
"node": true | ||
} | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ "@(test|benchmark)/*.js" ], | ||
"extends": [ | ||
"plugin:@wordpress/eslint-plugin/recommended" | ||
] | ||
} | ||
] | ||
} |
This file was deleted.
This file was deleted.
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.
So does this change essentially mean that packages consuming
wp-script
don't need@babel/core
as a dependency anymore?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.
At some point, it was added as a regular dependencies so it is redundant here.