newspack-scripts 3.1.0-alpha.1 → 3.1.0-alpha.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/bin/newspack-scripts.js +9 -3
- package/config/eslintrc.js +14 -0
- package/config/tsconfig.json +29 -0
- package/package.json +7 -6
- package/scripts/typescript-check.js +18 -0
package/bin/newspack-scripts.js
CHANGED
|
@@ -5,9 +5,15 @@ const spawn = require("cross-spawn");
|
|
|
5
5
|
const [scriptName, ...nodeArgs] = process.argv.slice(2);
|
|
6
6
|
|
|
7
7
|
if (
|
|
8
|
-
[
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
[
|
|
9
|
+
"test",
|
|
10
|
+
"build",
|
|
11
|
+
"watch",
|
|
12
|
+
"commit",
|
|
13
|
+
"commitlint",
|
|
14
|
+
"release",
|
|
15
|
+
"typescript-check",
|
|
16
|
+
].includes(scriptName)
|
|
11
17
|
) {
|
|
12
18
|
const result = spawn.sync(
|
|
13
19
|
process.execPath,
|
package/config/eslintrc.js
CHANGED
|
@@ -15,11 +15,22 @@ module.exports = {
|
|
|
15
15
|
"plugin:react/recommended",
|
|
16
16
|
"plugin:import/errors",
|
|
17
17
|
"plugin:import/warnings",
|
|
18
|
+
"plugin:@typescript-eslint/eslint-recommended",
|
|
19
|
+
"plugin:@typescript-eslint/recommended",
|
|
18
20
|
],
|
|
19
21
|
env: {
|
|
20
22
|
browser: true,
|
|
21
23
|
jest: true,
|
|
22
24
|
},
|
|
25
|
+
parser: "@typescript-eslint/parser",
|
|
26
|
+
plugins: ["@typescript-eslint"],
|
|
27
|
+
settings: {
|
|
28
|
+
"import/resolver": {
|
|
29
|
+
node: {
|
|
30
|
+
extensions: [".js", ".jsx", ".ts", ".tsx"],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
23
34
|
ignorePatterns: ["dist/", "node_modules/"],
|
|
24
35
|
parser: "@babel/eslint-parser",
|
|
25
36
|
rules: {
|
|
@@ -43,5 +54,8 @@ module.exports = {
|
|
|
43
54
|
"jsdoc/require-param": "off",
|
|
44
55
|
// Deprecated rules
|
|
45
56
|
"jsx-a11y/no-onchange": "off",
|
|
57
|
+
// For TypeScript type declarations.
|
|
58
|
+
camelcase: "off",
|
|
59
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
46
60
|
},
|
|
47
61
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"noEmit":true,
|
|
5
|
+
"rootDir": "src",
|
|
6
|
+
"composite": true,
|
|
7
|
+
"noEmitHelpers": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"lib": [
|
|
10
|
+
"ESNext",
|
|
11
|
+
"DOM",
|
|
12
|
+
"DOM.Iterable"
|
|
13
|
+
],
|
|
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
|
+
"include": [
|
|
26
|
+
"src",
|
|
27
|
+
"src/**/*.json"
|
|
28
|
+
]
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newspack-scripts",
|
|
3
|
-
"version": "3.1.0-alpha.
|
|
3
|
+
"version": "3.1.0-alpha.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"bin": {
|
|
6
6
|
"newspack-scripts": "./bin/newspack-scripts.js"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@wordpress/edit-post": "^5.0.17",
|
|
31
31
|
"@wordpress/element": "^4.0.4",
|
|
32
32
|
"@wordpress/escape-html": "^2.2.3",
|
|
33
|
-
"@wordpress/eslint-plugin": "^
|
|
33
|
+
"@wordpress/eslint-plugin": "^10.0.0",
|
|
34
34
|
"@wordpress/hooks": "^3.2.2",
|
|
35
35
|
"@wordpress/html-entities": "^3.2.3",
|
|
36
36
|
"@wordpress/i18n": "^4.2.4",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"commitizen": "^4.2.4",
|
|
45
45
|
"cross-spawn": "^7.0.3",
|
|
46
46
|
"cz-conventional-changelog": "^3.3.0",
|
|
47
|
-
"eslint": "^
|
|
47
|
+
"eslint": "^8.8.0",
|
|
48
48
|
"eslint-config-prettier": "^8.3.0",
|
|
49
|
-
"eslint-plugin-import": "^2.25.
|
|
50
|
-
"eslint-plugin-jest": "^
|
|
51
|
-
"eslint-plugin-react": "^7.
|
|
49
|
+
"eslint-plugin-import": "^2.25.4",
|
|
50
|
+
"eslint-plugin-jest": "^26.0.0",
|
|
51
|
+
"eslint-plugin-react": "^7.28.0",
|
|
52
52
|
"jest": "^27.4.3",
|
|
53
53
|
"jest-environment-jsdom": "^27.4.3",
|
|
54
54
|
"postcss": "^8.4.4",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"stylelint": "^14.1.0",
|
|
60
60
|
"stylelint-config-prettier": "^9.0.3",
|
|
61
61
|
"stylelint-prettier": "^2.0.0",
|
|
62
|
+
"typescript": "^4.5.5",
|
|
62
63
|
"webpack": "^5.65.0"
|
|
63
64
|
},
|
|
64
65
|
"scripts": {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const spawn = require("cross-spawn");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
console.log(path.resolve(__dirname, "../config/tsconfig.json"));
|
|
7
|
+
|
|
8
|
+
const result = spawn.sync(
|
|
9
|
+
`${process.cwd()}/node_modules/.bin/tsc`,
|
|
10
|
+
["--project", path.resolve(__dirname, "../config/tsconfig.json")],
|
|
11
|
+
{
|
|
12
|
+
stdio: "inherit",
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
console.log(result);
|
|
17
|
+
|
|
18
|
+
process.exit(result.status);
|