newspack-scripts 5.6.0-alpha.4 → 5.6.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/eslintrc.js +17 -13
- package/package.json +2 -1
package/config/eslintrc.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
const wpRecommended = require.resolve( '@wordpress/eslint-plugin/configs/recommended' );
|
|
2
2
|
const reactRecommended = require.resolve( '@wordpress/eslint-plugin/configs/react' );
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Assume `@wordpress/*` packages are available. This is because `@wordpress/scripts` is using
|
|
6
|
+
* Dependency Extraction Webpack Plugin to use core WP packages instead of those from
|
|
7
|
+
* node_modules. The packages should still be part of the project (they are listed in this
|
|
8
|
+
* project's package.json) so that they are available in testing environment.
|
|
9
|
+
*
|
|
10
|
+
* More on this:
|
|
11
|
+
* - https: *www.npmjs.com/package/@wordpress/dependency-extraction-webpack-plugin
|
|
12
|
+
* - https: *github.com/WordPress/gutenberg/issues/35630
|
|
13
|
+
*
|
|
14
|
+
* React is also included here as it's a peer dependency of @wordpress/scripts.
|
|
15
|
+
*/
|
|
16
|
+
const GLOBALLY_AVAILABLE_PACKAGES = [ '@wordpress/.*', 'react' ];
|
|
12
17
|
|
|
13
18
|
module.exports = {
|
|
14
19
|
extends: [
|
|
@@ -16,8 +21,8 @@ module.exports = {
|
|
|
16
21
|
'plugin:import/warnings',
|
|
17
22
|
'plugin:@typescript-eslint/eslint-recommended',
|
|
18
23
|
'plugin:@typescript-eslint/recommended',
|
|
19
|
-
wpRecommended,
|
|
20
24
|
reactRecommended,
|
|
25
|
+
wpRecommended,
|
|
21
26
|
],
|
|
22
27
|
env: {
|
|
23
28
|
browser: true,
|
|
@@ -36,7 +41,8 @@ module.exports = {
|
|
|
36
41
|
rules: {
|
|
37
42
|
'arrow-parens': 'off',
|
|
38
43
|
camelcase: 'off',
|
|
39
|
-
|
|
44
|
+
// Disallow logging.
|
|
45
|
+
'no-console': 'error',
|
|
40
46
|
'no-mixed-operators': 'off',
|
|
41
47
|
'wrap-iife': 'off',
|
|
42
48
|
// Some dependencies are injected by WP, and should not be declared in package.json (won't be used anyway).
|
|
@@ -60,14 +66,12 @@ module.exports = {
|
|
|
60
66
|
'@typescript-eslint/no-empty-function': 'off',
|
|
61
67
|
// Fail on unused vars.
|
|
62
68
|
'@typescript-eslint/no-unused-vars': 'error',
|
|
63
|
-
// Disallow logging.
|
|
64
|
-
'no-console': 'error',
|
|
65
69
|
// Handle the issue where no-shadow is a false positive when declaring TS enums.
|
|
66
70
|
// See https://github.com/typescript-eslint/typescript-eslint/issues/2483
|
|
67
71
|
'no-shadow': 'off',
|
|
68
72
|
'@typescript-eslint/no-shadow': 'error',
|
|
69
73
|
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
70
74
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
71
|
-
'prettier/prettier': 'off',
|
|
75
|
+
'prettier/prettier': 'off', // We're mainly concerned about code quality rules, not formatting. npm run format:js can be used to reformat JS if desired.
|
|
72
76
|
},
|
|
73
77
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newspack-scripts",
|
|
3
|
-
"version": "5.6.0-alpha.
|
|
3
|
+
"version": "5.6.0-alpha.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"bin": {
|
|
6
6
|
"newspack-scripts": "./bin/newspack-scripts.js"
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"prettier": "^3.3.2",
|
|
57
57
|
"semantic-release": "^19.0.5",
|
|
58
58
|
"semantic-release-version-bump": "^1.4.1",
|
|
59
|
+
"stylelint": "^16.6.1",
|
|
59
60
|
"typescript": "^5.4.5",
|
|
60
61
|
"yargs": "^17.7.2"
|
|
61
62
|
},
|