@lipemat/js-boilerplate 8.1.0-beta.1 → 8.2.1
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/package.json +3 -3
- package/scripts/lint.js +34 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lipemat/js-boilerplate",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.1",
|
|
4
4
|
"description": "Dependencies and scripts for a no config JavaScript app",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=14.17.6"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@babel/preset-typescript": "^7.12.7",
|
|
38
38
|
"@hot-loader/react-dom": "^17.0.1",
|
|
39
39
|
"@lipemat/css-mqpacker": "^8.0.1",
|
|
40
|
-
"@lipemat/eslint-config": "^2.0.
|
|
40
|
+
"@lipemat/eslint-config": "^2.0.1",
|
|
41
41
|
"@lipemat/postcss-loader": "^3.1.2",
|
|
42
42
|
"@lipemat/webpack-cleanup-plugin": "^1.0.0",
|
|
43
43
|
"@types/lipemat__js-boilerplate": "lipemat/types-js-boilerplate#semver:^1.3.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"react-test-renderer": "^17.0.2",
|
|
75
75
|
"react-transition-group": "^4.4.1",
|
|
76
76
|
"style-loader": "^3.2.1",
|
|
77
|
-
"typescript": "
|
|
77
|
+
"typescript": "~4.5.5",
|
|
78
78
|
"update-notifier": "^4.1.3",
|
|
79
79
|
"webpack": "^5.65.0",
|
|
80
80
|
"webpack-assets-manifest": "^5.0.6",
|
package/scripts/lint.js
CHANGED
|
@@ -1,4 +1,36 @@
|
|
|
1
|
-
const
|
|
1
|
+
const {ESLint} = require( 'eslint' );
|
|
2
2
|
const packageConfig = require( '../helpers/package-config' );
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Use the public API to run the eslint commands.
|
|
6
|
+
*
|
|
7
|
+
* @link https://eslint.org/docs/developer-guide/nodejs-api
|
|
8
|
+
*/
|
|
9
|
+
( async function main() {
|
|
10
|
+
// 1. Create an instance with the `fix` option.
|
|
11
|
+
const eslint = new ESLint( {
|
|
12
|
+
fix: true,
|
|
13
|
+
} );
|
|
14
|
+
|
|
15
|
+
// 2. Lint files. This doesn't modify target files.
|
|
16
|
+
const results = await eslint.lintFiles( [
|
|
17
|
+
packageConfig.workingDirectory + '/src/**/*.{js,jsx,ts,tsx}',
|
|
18
|
+
] );
|
|
19
|
+
|
|
20
|
+
// 3. Modify the files with the fixed code.
|
|
21
|
+
await ESLint.outputFixes( results );
|
|
22
|
+
|
|
23
|
+
// 4. Format the results.
|
|
24
|
+
const formatter = await eslint.loadFormatter( 'stylish' );
|
|
25
|
+
const resultText = formatter.format( results );
|
|
26
|
+
|
|
27
|
+
// 5. Output it.
|
|
28
|
+
console.log( resultText );
|
|
29
|
+
if ( '' === resultText ) {
|
|
30
|
+
console.log( '>> Linted JS files without errors.' );
|
|
31
|
+
console.log( '-----------------------------------' );
|
|
32
|
+
}
|
|
33
|
+
}() ).catch( error => {
|
|
34
|
+
process.exitCode = 1;
|
|
35
|
+
console.error( error );
|
|
36
|
+
} );
|