@digigov/cli-lint 1.0.5-rc.21 → 2.0.0-6452adf3
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/.eslintrc.cjs +3 -0
- package/.rush/temp/shrinkwrap-deps.json +6 -7
- package/{eslint.common.js → eslint.common.cjs} +4 -4
- package/eslint.config.cjs +1 -0
- package/eslintrc.cjs +5 -0
- package/index.js +51 -43
- package/package.json +19 -5
- package/prettierrc.cjs +5 -0
- package/.eslintrc.js +0 -2
- package/eslint.config.js +0 -1
- package/eslintrc.js +0 -6
- package/prettierrc.js +0 -6
- /package/{prettier.config.js → prettier.config.cjs} +0 -0
package/.eslintrc.cjs
ADDED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"../../tooling/cli-lint": "../../tooling/cli-lint:
|
|
3
|
-
"/@babel/eslint-parser@7.19.1(@babel/core@7.
|
|
4
|
-
"/@oclif/command@1.8.0(@oclif/config@1.18.17)(supports-color@7.2.0)": "Missing shrinkwrap entry!",
|
|
2
|
+
"../../tooling/cli-lint": "../../tooling/cli-lint:cy3nEVIy8qFekXJOPYJsix+a/IMyeyVmow3qjmPxCOM=:",
|
|
3
|
+
"/@babel/eslint-parser@7.19.1(@babel/core@7.26.0)(eslint@8.56.0)": "Missing shrinkwrap entry!",
|
|
5
4
|
"/@rushstack/eslint-patch@1.7.2": "Missing shrinkwrap entry!",
|
|
6
5
|
"/@typescript-eslint/eslint-plugin@6.19.1(@typescript-eslint/parser@6.19.1(eslint@8.56.0)(typescript@5.6.2))(eslint@8.56.0)(typescript@5.6.2)": "Missing shrinkwrap entry!",
|
|
7
6
|
"/@typescript-eslint/parser@6.19.1(eslint@8.56.0)(typescript@5.6.2)": "Missing shrinkwrap entry!",
|
|
8
7
|
"/eslint-config-prettier@9.1.0(eslint@8.56.0)": "Missing shrinkwrap entry!",
|
|
9
|
-
"/eslint-import-resolver-babel-module@5.3.2(@babel/core@7.
|
|
8
|
+
"/eslint-import-resolver-babel-module@5.3.2(@babel/core@7.26.0)(babel-plugin-module-resolver@4.0.0)": "Missing shrinkwrap entry!",
|
|
10
9
|
"/eslint-plugin-css-modules@2.12.0(eslint@8.56.0)": "Missing shrinkwrap entry!",
|
|
11
10
|
"/eslint-plugin-enzyme@0.2.0(eslint@8.56.0)": "Missing shrinkwrap entry!",
|
|
12
11
|
"/eslint-plugin-import@2.29.1(eslint@8.56.0)": "Missing shrinkwrap entry!",
|
|
13
|
-
"/eslint-plugin-jest@27.6.3(@typescript-eslint/eslint-plugin@6.19.1(@typescript-eslint/parser@6.19.1(eslint@8.56.0)(typescript@5.6.2))(eslint@8.56.0)(typescript@5.6.2))(eslint@8.56.0)(jest@29.0.2(@
|
|
12
|
+
"/eslint-plugin-jest@27.6.3(@typescript-eslint/eslint-plugin@6.19.1(@typescript-eslint/parser@6.19.1(eslint@8.56.0)(typescript@5.6.2))(eslint@8.56.0)(typescript@5.6.2))(eslint@8.56.0)(jest@29.0.2(babel-plugin-macros@3.1.0)(node-notifier@8.0.2))(typescript@5.6.2)": "Missing shrinkwrap entry!",
|
|
14
13
|
"/eslint-plugin-json@3.1.0": "Missing shrinkwrap entry!",
|
|
15
14
|
"/eslint-plugin-mdx@2.3.4(eslint@8.56.0)": "Missing shrinkwrap entry!",
|
|
16
15
|
"/eslint-plugin-prettier@5.1.3(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@8.56.0))(eslint@8.56.0)(prettier@3.2.5)": "Missing shrinkwrap entry!",
|
|
@@ -18,7 +17,7 @@
|
|
|
18
17
|
"/eslint-plugin-react-hooks@4.6.0(eslint@8.56.0)": "Missing shrinkwrap entry!",
|
|
19
18
|
"/eslint-plugin-react@7.33.2(eslint@8.56.0)": "Missing shrinkwrap entry!",
|
|
20
19
|
"/eslint@8.56.0": "Missing shrinkwrap entry!",
|
|
21
|
-
"/execa@5.0.0": "Missing shrinkwrap entry!",
|
|
22
20
|
"/prettier@3.2.5": "Missing shrinkwrap entry!",
|
|
23
|
-
"/publint@0.1.8": "Missing shrinkwrap entry!"
|
|
21
|
+
"/publint@0.1.8": "Missing shrinkwrap entry!",
|
|
22
|
+
"/typescript@5.6.2": "Missing shrinkwrap entry!"
|
|
24
23
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
const prettierrc = require('./prettier.config');
|
|
1
|
+
const { resolveProject } = require('@digigov/cli/lib');
|
|
2
|
+
const prettierrc = require('./prettier.config.cjs');
|
|
3
3
|
require('@rushstack/eslint-patch/modern-module-resolution');
|
|
4
4
|
function makeEslintConfig(dir) {
|
|
5
|
-
const project =
|
|
5
|
+
const project = resolveProject(dir);
|
|
6
6
|
let restConfig = {};
|
|
7
7
|
let rules = {};
|
|
8
8
|
const plugins = [];
|
|
@@ -33,7 +33,7 @@ function makeEslintConfig(dir) {
|
|
|
33
33
|
parser: '@babel/eslint-parser',
|
|
34
34
|
parserOptions: {
|
|
35
35
|
babelOptions: {
|
|
36
|
-
configFile: require.resolve('@digigov/cli-build/babel.config.
|
|
36
|
+
configFile: require.resolve('@digigov/cli-build/babel.config.cjs'),
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./eslintrc.cjs')();
|
package/eslintrc.cjs
ADDED
package/index.js
CHANGED
|
@@ -1,45 +1,53 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
30
|
-
}
|
|
31
|
-
const files = args.files || project.src;
|
|
32
|
-
const proc = this.exec(
|
|
33
|
-
this.script,
|
|
34
|
-
[
|
|
35
|
-
files,
|
|
36
|
-
'--ext',
|
|
37
|
-
ext.join(','),
|
|
38
|
-
...cmdArgs,
|
|
39
|
-
...argv.filter((a) => a !== files),
|
|
40
|
-
],
|
|
41
|
-
{ env: {}, stdio: 'inherit' }
|
|
1
|
+
import { DigigovCommand, resolveProject } from '@digigov/cli/lib';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
const command = new DigigovCommand('lint', import.meta.url);
|
|
6
|
+
|
|
7
|
+
const FILE_EXTENSIONS = ['.js', '.jsx', '.json', '.ts', '.tsx', '.mdx'];
|
|
8
|
+
|
|
9
|
+
command
|
|
10
|
+
.argument('[filter...]', 'Filter files')
|
|
11
|
+
.helpOption(false)
|
|
12
|
+
.allowUnknownOption()
|
|
13
|
+
.action(lint);
|
|
14
|
+
|
|
15
|
+
export default command;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @param {string[]} args - The arguments
|
|
19
|
+
* @param {DigigovCommand} ctx - The command context
|
|
20
|
+
*/
|
|
21
|
+
async function lint(args, _, ctx) {
|
|
22
|
+
const project = resolveProject();
|
|
23
|
+
|
|
24
|
+
if (project.isTs) {
|
|
25
|
+
let tsconfigPath = path.join(project.root, 'tsconfig.json');
|
|
26
|
+
|
|
27
|
+
const tsconfigProduction = path.join(
|
|
28
|
+
project.root,
|
|
29
|
+
'tsconfig.production.json'
|
|
42
30
|
);
|
|
43
|
-
|
|
31
|
+
if (fs.existsSync(tsconfigProduction)) {
|
|
32
|
+
tsconfigPath = tsconfigProduction;
|
|
33
|
+
}
|
|
34
|
+
await ctx.exec('tsc', ['--noEmit', '--project', tsconfigPath]);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const cmdArgs = [];
|
|
38
|
+
if (project.ignore) {
|
|
39
|
+
cmdArgs.push('--ignore-path', project.ignore);
|
|
44
40
|
}
|
|
45
|
-
|
|
41
|
+
await ctx.exec(
|
|
42
|
+
'eslint',
|
|
43
|
+
[
|
|
44
|
+
'--ext',
|
|
45
|
+
FILE_EXTENSIONS.join(','),
|
|
46
|
+
'--no-error-on-unmatched-pattern',
|
|
47
|
+
...cmdArgs,
|
|
48
|
+
...args,
|
|
49
|
+
],
|
|
50
|
+
{ env: {}, stdio: 'inherit' }
|
|
51
|
+
);
|
|
52
|
+
return;
|
|
53
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/cli-lint",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-6452adf3",
|
|
4
4
|
"description": "Lint plugin for Digigov CLI",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"author": "GRNET Devs <devs@lists.grnet.gr>",
|
|
7
8
|
"license": "BSD-2-Clause",
|
|
8
9
|
"dependencies": {
|
|
9
10
|
"@babel/eslint-parser": "7.19.1",
|
|
10
|
-
"@oclif/command": "1.8.0",
|
|
11
11
|
"@typescript-eslint/eslint-plugin": "6.19.1",
|
|
12
12
|
"@typescript-eslint/parser": "6.19.1",
|
|
13
13
|
"eslint-config-prettier": "9.1.0",
|
|
@@ -22,21 +22,35 @@
|
|
|
22
22
|
"eslint-plugin-promise": "6.1.1",
|
|
23
23
|
"eslint-plugin-react": "7.33.2",
|
|
24
24
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
25
|
-
"execa": "5.0.0",
|
|
26
25
|
"@rushstack/eslint-patch": "1.7.2",
|
|
27
26
|
"publint": "0.1.8",
|
|
28
27
|
"eslint-plugin-digigov": "1.0.0"
|
|
29
28
|
},
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./index.js",
|
|
31
|
+
"./eslint.common": "./eslint.common.cjs",
|
|
32
|
+
"./eslint.config": "./eslint.config.cjs",
|
|
33
|
+
"./eslintrc": "./eslintrc.cjs",
|
|
34
|
+
"./prettier.config": "./prettier.config.cjs",
|
|
35
|
+
"./prettierrc": "./prettierrc.cjs"
|
|
36
|
+
},
|
|
30
37
|
"devDependencies": {
|
|
31
38
|
"publint": "0.1.8"
|
|
32
39
|
},
|
|
33
40
|
"peerDependencies": {
|
|
34
|
-
"@digigov/cli": "
|
|
35
|
-
"@digigov/cli-build": "2.0.0-
|
|
41
|
+
"@digigov/cli": "2.0.0-6452adf3",
|
|
42
|
+
"@digigov/cli-build": "2.0.0-6452adf3",
|
|
36
43
|
"prettier": "3.2.5",
|
|
44
|
+
"typescript": "*",
|
|
37
45
|
"eslint": "8.56.0"
|
|
38
46
|
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"typescript": {
|
|
49
|
+
"optional": true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
39
52
|
"scripts": {
|
|
53
|
+
"lint": "eslint --ext .js .",
|
|
40
54
|
"publint": "publint"
|
|
41
55
|
}
|
|
42
56
|
}
|
package/prettierrc.cjs
ADDED
package/.eslintrc.js
DELETED
package/eslint.config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./eslintrc')()
|
package/eslintrc.js
DELETED
package/prettierrc.js
DELETED
|
File without changes
|