newspack-scripts 5.5.1 → 5.5.2
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/.circleci/config.yml +1 -1
- package/.eslintrc.js +9 -0
- package/.nvmrc +1 -1
- package/README.md +93 -31
- package/bin/newspack-scripts.js +35 -35
- package/config/babel.config.js +6 -7
- package/config/commitlint.config.js +1 -1
- package/config/eslintrc.js +74 -62
- package/config/getWebpackConfig.js +21 -23
- package/config/postcss.config.js +3 -3
- package/config/prettier.config.js +6 -0
- package/config/stylelint.config.js +32 -28
- package/config/tsconfig.json +24 -20
- package/package.json +85 -82
- package/scripts/commit.js +10 -10
- package/scripts/commitlint.js +10 -9
- package/scripts/release.js +143 -145
- package/scripts/semantic-release.js +25 -0
- package/scripts/test.js +42 -32
- package/scripts/typescript-check.js +11 -12
- package/scripts/utils/babelJestTransformer.js +11 -12
- package/scripts/utils/index.js +17 -17
- package/scripts/utils/jestSetup.js +35 -35
- package/scripts/utils/modules.js +22 -3
- package/scripts/wp-scripts.js +23 -0
- package/src/jobs/lint-js-scss.yml +2 -2
- package/scripts/build.js +0 -19
- package/scripts/watch.js +0 -13
package/.circleci/config.yml
CHANGED
package/.eslintrc.js
ADDED
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
lts/*
|
package/README.md
CHANGED
|
@@ -6,20 +6,46 @@ Scripts for Newspack, heavily inspired by [`react-scripts`](https://github.com/f
|
|
|
6
6
|
|
|
7
7
|
## Available scripts
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Repos consuming the `newspack-scripts` package can use the following NPM scripts. Prefix each at the command line with `npm run` (or [`bun run`](https://bun.sh/)) to execute.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### start
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
- `--coverage` to collect test coverage
|
|
13
|
+
Execute with `npm start`. This is the only script you run without the `run` prefix. This will install Composer and NPM dependencies, then run the `watch` command to start a development build. Best used when cloning a repo for the first time, or when you need to restore a locally cloned repo to a fresh state.
|
|
15
14
|
|
|
16
15
|
### build
|
|
17
16
|
|
|
18
|
-
Will run `
|
|
17
|
+
Will run `wp-scripts build` to create optimised production builds.
|
|
19
18
|
|
|
20
19
|
### watch
|
|
21
20
|
|
|
22
|
-
Will run `
|
|
21
|
+
Will run `wp-scripts start` to start a development build in devserver/watch mode.
|
|
22
|
+
|
|
23
|
+
### lint:js, lint:scss, lint
|
|
24
|
+
|
|
25
|
+
Will run `wp-scripts lint-js`, `wp-scripts lint-style`, or both. See the [`@wordpress/scripts` handbook](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/) for implementation details and additional options.
|
|
26
|
+
|
|
27
|
+
### fix:js
|
|
28
|
+
|
|
29
|
+
Will run `wp-scripts lint-js --fix`, allowing ESLint to correct any autofixable code quality errors it finds. Note that code quality errors are separate from formatting, which is handled by `format:js` (see below).
|
|
30
|
+
|
|
31
|
+
### format:js
|
|
32
|
+
|
|
33
|
+
Will run `wp-scripts format-js` to reformat JS files according to [Prettier](https://prettier.io/) rules. Note that formatting is separate from code quality errors, which are handled by `fix:js` (see above).
|
|
34
|
+
|
|
35
|
+
### format:scss
|
|
36
|
+
|
|
37
|
+
Will run `wp-scripts lint-style --fix` to reformat SCSS files according to [Stylelint](https://stylelint.io/) rules.
|
|
38
|
+
|
|
39
|
+
### test
|
|
40
|
+
|
|
41
|
+
Will run `jest` tests. Useful flags:
|
|
42
|
+
|
|
43
|
+
- `--watch` to run in file watch mode,
|
|
44
|
+
- `--coverage` to collect test coverage
|
|
45
|
+
|
|
46
|
+
### lint:php, fix:php
|
|
47
|
+
|
|
48
|
+
Will run `phpcs` or `phpcbf` to lint or autofix PHP files, respectively. Note that you must install these PHP packages via `composer install` or `npm start` before you can use these locally.
|
|
23
49
|
|
|
24
50
|
### commit
|
|
25
51
|
|
|
@@ -39,11 +65,15 @@ Will validate TypeScript code in the project. This requires a `tsconfig.json` fi
|
|
|
39
65
|
|
|
40
66
|
```json
|
|
41
67
|
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
68
|
+
"extends": "newspack-scripts/config/tsconfig.json",
|
|
69
|
+
"compilerOptions": {
|
|
70
|
+
"rootDir": "src",
|
|
71
|
+
"jsx": "react-jsx"
|
|
72
|
+
},
|
|
73
|
+
"include": [
|
|
74
|
+
"src",
|
|
75
|
+
"src/**/*.json"
|
|
76
|
+
]
|
|
47
77
|
}
|
|
48
78
|
```
|
|
49
79
|
|
|
@@ -115,12 +145,11 @@ The `webpack.config.js` file should use this package's config-extending function
|
|
|
115
145
|
const getBaseWebpackConfig = require("newspack-scripts/config/getWebpackConfig");
|
|
116
146
|
|
|
117
147
|
const webpackConfig = getBaseWebpackConfig(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
148
|
+
{
|
|
149
|
+
entry: {
|
|
150
|
+
'output-file': './src/entrypoint-file.js',
|
|
151
|
+
},
|
|
152
|
+
}
|
|
124
153
|
);
|
|
125
154
|
|
|
126
155
|
module.exports = webpackConfig;
|
|
@@ -131,36 +160,69 @@ module.exports = webpackConfig;
|
|
|
131
160
|
A basic `babel.config.js`:
|
|
132
161
|
|
|
133
162
|
```js
|
|
134
|
-
module.exports =
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
163
|
+
module.exports = api => {
|
|
164
|
+
api.cache( true );
|
|
165
|
+
return {
|
|
166
|
+
extends: 'newspack-scripts/config/babel.config.js',
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### ESLint
|
|
172
|
+
|
|
173
|
+
`@wordpress/scripts` uses ESLint under the hood for JS code quality linting. Note that this is separate from code formatting, which is handled by Prettier (see below).
|
|
174
|
+
|
|
175
|
+
Because of ESLint's [issue](https://github.com/eslint/eslint/issues/3458) with resolving dependencies of extended configurations, a patch has to be used to use this config in a stand-alone fashion: install `@rushstack/eslint-patch` and set up the `.eslintrc.js` like so:
|
|
176
|
+
|
|
177
|
+
```js
|
|
178
|
+
require( '@rushstack/eslint-patch/modern-module-resolution' );
|
|
179
|
+
|
|
180
|
+
module.exports = {
|
|
181
|
+
extends: [ './node_modules/newspack-scripts/config/eslintrc.js' ],
|
|
182
|
+
// Additional options…
|
|
139
183
|
};
|
|
140
184
|
```
|
|
141
185
|
|
|
142
|
-
###
|
|
186
|
+
### Prettier
|
|
143
187
|
|
|
144
|
-
|
|
188
|
+
`@wordpress/scripts` uses [Prettier](https://prettier.io/) under the hood for JS formatting. Note that this is separate from code quality, which is handled by ESLint (see above).
|
|
189
|
+
|
|
190
|
+
To configure Prettier rules, extend this repo's config by creating a `.prettierrc.js` file like so:
|
|
145
191
|
|
|
146
192
|
```js
|
|
147
|
-
require(
|
|
193
|
+
const baseConfig = require( './node_modules/newspack-scripts/config/prettier.config.js' );
|
|
148
194
|
|
|
149
195
|
module.exports = {
|
|
150
|
-
|
|
151
|
-
|
|
196
|
+
...baseConfig,
|
|
197
|
+
// Additional options…
|
|
152
198
|
};
|
|
153
199
|
```
|
|
154
200
|
|
|
201
|
+
You should also include a [`.prettierignore` file](https://prettier.io/docs/en/ignore.html) to tell Prettier which files and directories it should ignore, using [gitignore syntax](https://git-scm.com/docs/gitignore#_pattern_format):
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
dist
|
|
205
|
+
node_modules
|
|
206
|
+
release
|
|
207
|
+
vendor
|
|
208
|
+
```
|
|
209
|
+
|
|
155
210
|
### stylelint
|
|
156
211
|
|
|
157
|
-
|
|
212
|
+
`@wordpress/scripts` uses [Stylelint](https://stylelint.io/) under the hood for SCSS linting and formatting.
|
|
158
213
|
|
|
159
214
|
```shell
|
|
160
|
-
|
|
215
|
+
newspack-scripts wp-scripts lint-style '**/*.scss' --customSyntax postcss-scss
|
|
161
216
|
```
|
|
162
217
|
|
|
163
|
-
|
|
218
|
+
Extend this repo's config with a `.stylelintrc.js` file like so:
|
|
219
|
+
|
|
220
|
+
```js
|
|
221
|
+
module.exports = {
|
|
222
|
+
extends: [ './node_modules/newspack-scripts/config/stylelint.config.js' ],
|
|
223
|
+
// Additional options…
|
|
224
|
+
};
|
|
225
|
+
```
|
|
164
226
|
|
|
165
227
|
### TypeScript
|
|
166
228
|
|
|
@@ -207,4 +269,4 @@ Note that before the first time updating you'll need to set the API key for Circ
|
|
|
207
269
|
|
|
208
270
|
### `@wordpress/*` packages
|
|
209
271
|
|
|
210
|
-
This project
|
|
272
|
+
This project lists [`@wordpress/*` packages](https://github.com/WordPress/gutenberg/tree/trunk/packages) as dependencies in order to provide them to consumers. In a project using `@wordpress/scripts` (e.g. a consumer of `newspack-scripts`), the `@wordpress/*` packages are sourced from WP Core, not `node_modules`. The packages should be included in `node_modules`, though, to be available in other environments – notably when running tests. See [Dependency Extraction Webpack Plugin](https://www.npmjs.com/package/@wordpress/dependency-extraction-webpack-plugin) for more information.
|
package/bin/newspack-scripts.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const spawn = require(
|
|
4
|
-
const utils = require(
|
|
3
|
+
const spawn = require( 'cross-spawn' );
|
|
4
|
+
const utils = require( '../scripts/utils/index.js' );
|
|
5
5
|
|
|
6
|
-
const [scriptName, ...nodeArgs] = process.argv.slice(2);
|
|
6
|
+
const [ scriptName, ...nodeArgs ] = process.argv.slice( 2 );
|
|
7
7
|
|
|
8
8
|
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
[
|
|
10
|
+
'test',
|
|
11
|
+
'commit',
|
|
12
|
+
'commitlint',
|
|
13
|
+
'release',
|
|
14
|
+
'semantic-release',
|
|
15
|
+
'typescript-check',
|
|
16
|
+
'wp-scripts',
|
|
17
|
+
].includes( scriptName )
|
|
18
18
|
) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
19
|
+
const result = spawn.sync(
|
|
20
|
+
process.execPath,
|
|
21
|
+
[ require.resolve( '../scripts/' + scriptName ), ...nodeArgs ],
|
|
22
|
+
{ stdio: 'inherit' }
|
|
23
|
+
);
|
|
24
|
+
if ( result.signal ) {
|
|
25
|
+
if ( result.signal === 'SIGKILL' ) {
|
|
26
|
+
utils.log(
|
|
27
|
+
'The build failed because the process exited too early. ' +
|
|
28
|
+
'This probably means the system ran out of memory or someone called ' +
|
|
29
|
+
'`kill -9` on the process.'
|
|
30
|
+
);
|
|
31
|
+
} else if ( result.signal === 'SIGTERM' ) {
|
|
32
|
+
utils.log(
|
|
33
|
+
'The build failed because the process exited too early. ' +
|
|
34
|
+
'Someone might have called `kill` or `killall`, or the system could ' +
|
|
35
|
+
'be shutting down.'
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
process.exit( 1 );
|
|
39
|
+
}
|
|
40
|
+
process.exit( result.status );
|
|
41
41
|
} else {
|
|
42
|
-
|
|
42
|
+
utils.log( `Unknown script "${ scriptName }".` );
|
|
43
43
|
}
|
package/config/babel.config.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
module.exports = api => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
2
|
+
api.cache( true );
|
|
3
|
+
return {
|
|
4
|
+
presets: [
|
|
5
|
+
'@wordpress/babel-preset-default',
|
|
6
|
+
],
|
|
7
|
+
};
|
|
9
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = { extends: [
|
|
1
|
+
module.exports = { extends: [ '@commitlint/config-conventional' ] };
|
package/config/eslintrc.js
CHANGED
|
@@ -1,65 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
const wpRecommended = require.resolve( '@wordpress/eslint-plugin/configs/recommended' );
|
|
2
|
+
const reactRecommended = require.resolve( '@wordpress/eslint-plugin/configs/react' );
|
|
3
|
+
|
|
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' ];
|
|
9
17
|
|
|
10
18
|
module.exports = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
19
|
+
extends: [
|
|
20
|
+
'plugin:import/errors',
|
|
21
|
+
'plugin:import/warnings',
|
|
22
|
+
'plugin:@typescript-eslint/eslint-recommended',
|
|
23
|
+
'plugin:@typescript-eslint/recommended',
|
|
24
|
+
reactRecommended,
|
|
25
|
+
wpRecommended,
|
|
26
|
+
],
|
|
27
|
+
env: {
|
|
28
|
+
browser: true,
|
|
29
|
+
jest: true,
|
|
30
|
+
},
|
|
31
|
+
parser: '@typescript-eslint/parser',
|
|
32
|
+
plugins: [ '@typescript-eslint' ],
|
|
33
|
+
settings: {
|
|
34
|
+
'import/resolver': {
|
|
35
|
+
node: {
|
|
36
|
+
extensions: [ '.js', '.jsx', '.ts', '.tsx' ],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
ignorePatterns: [ 'dist/', 'node_modules/', 'release/', 'scripts/', '/vendor' ],
|
|
41
|
+
rules: {
|
|
42
|
+
'arrow-parens': 'off',
|
|
43
|
+
camelcase: 'off',
|
|
44
|
+
// Disallow logging.
|
|
45
|
+
'no-console': 'error',
|
|
46
|
+
'no-mixed-operators': 'off',
|
|
47
|
+
'wrap-iife': 'off',
|
|
48
|
+
// Some dependencies are injected by WP, and should not be declared in package.json (won't be used anyway).
|
|
49
|
+
// See https://github.com/WordPress/gutenberg/blob/e035f71/packages/dependency-extraction-webpack-plugin/README.md#behavior-with-scripts
|
|
50
|
+
// Unfortunately there's no "ignore" option for this rule, so it's disabled altogether.
|
|
51
|
+
'import/no-extraneous-dependencies': 'off',
|
|
52
|
+
'import/no-unresolved': [ 'error', { ignore: GLOBALLY_AVAILABLE_PACKAGES } ],
|
|
53
|
+
'import/namespace': 'off',
|
|
54
|
+
// There's a conflict with prettier here:
|
|
55
|
+
'react/jsx-curly-spacing': 'off',
|
|
56
|
+
// Skip prop types validation for now
|
|
57
|
+
'react/prop-types': 'off',
|
|
58
|
+
'react/react-in-jsx-scope': 'off',
|
|
59
|
+
'react/self-closing-comp': 'error',
|
|
60
|
+
'react-hooks/exhaustive-deps': 'off',
|
|
61
|
+
// JSDoc rules overrides
|
|
62
|
+
'jsdoc/require-returns': 'off',
|
|
63
|
+
'jsdoc/require-param': 'off',
|
|
64
|
+
// Deprecated rules
|
|
65
|
+
'jsx-a11y/no-onchange': 'off',
|
|
66
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
67
|
+
// Fail on unused vars.
|
|
68
|
+
'@typescript-eslint/no-unused-vars': 'error',
|
|
69
|
+
// Handle the issue where no-shadow is a false positive when declaring TS enums.
|
|
70
|
+
// See https://github.com/typescript-eslint/typescript-eslint/issues/2483
|
|
71
|
+
'no-shadow': 'off',
|
|
72
|
+
'@typescript-eslint/no-shadow': 'error',
|
|
73
|
+
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
74
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
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.
|
|
76
|
+
},
|
|
65
77
|
};
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
const path = require(
|
|
1
|
+
const path = require( 'path' );
|
|
2
|
+
require( '@wordpress/browserslist-config' );
|
|
3
|
+
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
module.exports = ( ...args ) => {
|
|
6
|
+
let config = { ...defaultConfig };
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
// Merge config extensions into default config.
|
|
9
|
+
args.forEach( extension => {
|
|
10
|
+
config = { ...config, ...extension };
|
|
11
|
+
} );
|
|
7
12
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
postCssLoader.options.postcssOptions.config = postCssConfigPath;
|
|
21
|
-
config.module.rules[scssRuleIndex].use[
|
|
22
|
-
postCssLoaderIndex
|
|
23
|
-
] = postCssLoader;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return config;
|
|
13
|
+
// Ensure that webpack resolves modules from the Newspack Scripts node_modules as well as the root repo's node_modules.
|
|
14
|
+
config.resolve.modules = [
|
|
15
|
+
path.resolve( __dirname, '../node_modules' ),
|
|
16
|
+
'node_modules',
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
// Clear cacheGroups so that CSS files don't get the `style-` prefix.
|
|
20
|
+
if ( config?.optimization?.splitChunks?.cacheGroups?.style ) {
|
|
21
|
+
delete config.optimization.splitChunks.cacheGroups.style;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return config;
|
|
27
25
|
};
|
package/config/postcss.config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const postcssFocusWithin = require(
|
|
2
|
-
const autoprefixer = require(
|
|
1
|
+
const postcssFocusWithin = require( 'postcss-focus-within' );
|
|
2
|
+
const autoprefixer = require( 'autoprefixer' );
|
|
3
3
|
|
|
4
4
|
module.exports = {
|
|
5
|
-
|
|
5
|
+
plugins: [ autoprefixer(), postcssFocusWithin() ],
|
|
6
6
|
};
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
extends: [
|
|
3
|
+
'@wordpress/stylelint-config',
|
|
4
|
+
],
|
|
5
|
+
rules: {
|
|
6
|
+
'rule-empty-line-before': null,
|
|
7
|
+
'at-rule-empty-line-before': null,
|
|
8
|
+
'comment-empty-line-before': null,
|
|
9
|
+
'no-descending-specificity': null,
|
|
10
|
+
'function-url-quotes': null,
|
|
11
|
+
'font-weight-notation': null,
|
|
12
|
+
'color-named': null,
|
|
13
|
+
'selector-class-pattern': null,
|
|
14
|
+
'custom-property-pattern': null,
|
|
15
|
+
'at-rule-no-unknown': null,
|
|
16
|
+
'alpha-value-notation': null,
|
|
17
|
+
'color-function-notation': null,
|
|
18
|
+
'selector-not-notation': null,
|
|
19
|
+
'function-no-unknown': [
|
|
20
|
+
true,
|
|
21
|
+
{
|
|
22
|
+
ignoreFunctions: [ '/color/' ],
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
'annotation-no-unknown': [
|
|
26
|
+
true,
|
|
27
|
+
{
|
|
28
|
+
ignoreAnnotations: [ '/default/' ],
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
'media-feature-range-notation': null,
|
|
32
|
+
'max-line-length': null,
|
|
33
|
+
},
|
|
30
34
|
};
|
package/config/tsconfig.json
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"noEmit": true,
|
|
5
|
+
"composite": true,
|
|
6
|
+
"noEmitHelpers": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"lib": [
|
|
9
|
+
"ESNext",
|
|
10
|
+
"DOM",
|
|
11
|
+
"DOM.Iterable"
|
|
12
|
+
],
|
|
13
|
+
"target": "es6",
|
|
14
|
+
"module": "ESNext",
|
|
15
|
+
"esModuleInterop": true,
|
|
16
|
+
"jsx": "react-jsx",
|
|
17
|
+
"strict": true,
|
|
18
|
+
"isolatedModules": true,
|
|
19
|
+
"moduleResolution": "node",
|
|
20
|
+
"resolveJsonModule": true,
|
|
21
|
+
"forceConsistentCasingInFileNames": true,
|
|
22
|
+
"allowJs": true,
|
|
23
|
+
"checkJs": false
|
|
24
|
+
}
|
|
25
|
+
}
|