@genesislcap/eslint-stylelint-builder 14.57.2-alpha-ace415db47.0 → 14.59.0
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/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -14
- package/package.json +3 -3
- package/src/index.ts +19 -14
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;8BAGhC,YAAY;AAAvC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;8BAGhC,YAAY;AAAvC,wBA8BE"}
|
package/dist/index.js
CHANGED
|
@@ -4,21 +4,26 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const build_kit_1 = require("@genesislcap/build-kit");
|
|
5
5
|
const consola_1 = tslib_1.__importDefault(require("consola"));
|
|
6
6
|
exports.default = (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
7
|
-
const { dirs: { cwd }, cli: { options: { profile, linter, fix }, }, } = ctx;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const { dirs: { cwd }, cli: { isLint, options: { profile, linter, fix }, }, } = ctx;
|
|
8
|
+
if (isLint) {
|
|
9
|
+
const fixArg = fix ? ' --fix' : '';
|
|
10
|
+
if (!linter || linter === 'eslint' || linter === 'all') {
|
|
11
|
+
consola_1.default.info('Running ESLint...');
|
|
12
|
+
if (profile) {
|
|
13
|
+
process.env.TIMING = '1';
|
|
14
|
+
}
|
|
15
|
+
const eslint = yield (0, build_kit_1.resolveBin)('eslint');
|
|
16
|
+
(0, build_kit_1.run)(cwd, `${eslint} "./**/*.{ts,js}" ${fixArg}`);
|
|
17
|
+
consola_1.default.success('ESLint completed');
|
|
18
|
+
}
|
|
19
|
+
if (!linter || linter === 'stylelint' || linter === 'all') {
|
|
20
|
+
consola_1.default.info('Running Stylelint...');
|
|
21
|
+
const stylelint = yield (0, build_kit_1.resolveBin)('stylelint');
|
|
22
|
+
(0, build_kit_1.run)(cwd, `${stylelint} "./**/*.styles.ts" ${fixArg}`);
|
|
23
|
+
consola_1.default.success('Stylelint completed');
|
|
13
24
|
}
|
|
14
|
-
const eslint = yield (0, build_kit_1.resolveBin)('eslint');
|
|
15
|
-
(0, build_kit_1.run)(cwd, `${eslint} "./**/*.{ts,js}" ${fixArg}`);
|
|
16
|
-
consola_1.default.success('ESLint completed');
|
|
17
25
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const stylelint = yield (0, build_kit_1.resolveBin)('stylelint');
|
|
21
|
-
(0, build_kit_1.run)(cwd, `${stylelint} "./**/*.styles.ts" ${fixArg}`);
|
|
22
|
-
consola_1.default.success('Stylelint completed');
|
|
26
|
+
else {
|
|
27
|
+
throw new Error(`Unrecognized command: ${JSON.stringify(ctx.cli.options)}`);
|
|
23
28
|
}
|
|
24
29
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/eslint-stylelint-builder",
|
|
3
3
|
"description": "ESLint/Stylelint builder",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.59.0",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dev": "tsc -b ./tsconfig.json -w"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@genesislcap/build-kit": "14.
|
|
14
|
+
"@genesislcap/build-kit": "14.59.0",
|
|
15
15
|
"consola": "^3.0.2",
|
|
16
16
|
"eslint": "8.22.0",
|
|
17
17
|
"stylelint": "^14.0.0",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "9e694bb994fa48b71b0c6301a3ad72f54671d117"
|
|
33
33
|
}
|
package/src/index.ts
CHANGED
|
@@ -6,25 +6,30 @@ export default async (ctx: BuildContext) => {
|
|
|
6
6
|
const {
|
|
7
7
|
dirs: { cwd },
|
|
8
8
|
cli: {
|
|
9
|
+
isLint,
|
|
9
10
|
options: { profile, linter, fix },
|
|
10
11
|
},
|
|
11
12
|
} = ctx;
|
|
12
|
-
|
|
13
|
+
if (isLint) {
|
|
14
|
+
const fixArg = fix ? ' --fix' : '';
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
if (!linter || linter === 'eslint' || linter === 'all') {
|
|
17
|
+
consola.info('Running ESLint...');
|
|
18
|
+
if (profile) {
|
|
19
|
+
process.env.TIMING = '1';
|
|
20
|
+
}
|
|
21
|
+
const eslint = await resolveBin('eslint');
|
|
22
|
+
run(cwd, `${eslint} "./**/*.{ts,js}" ${fixArg}`);
|
|
23
|
+
consola.success('ESLint completed');
|
|
18
24
|
}
|
|
19
|
-
const eslint = await resolveBin('eslint');
|
|
20
|
-
run(cwd, `${eslint} "./**/*.{ts,js}" ${fixArg}`);
|
|
21
|
-
consola.success('ESLint completed');
|
|
22
|
-
}
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
if (!linter || linter === 'stylelint' || linter === 'all') {
|
|
27
|
+
consola.info('Running Stylelint...');
|
|
28
|
+
const stylelint = await resolveBin('stylelint');
|
|
29
|
+
run(cwd, `${stylelint} "./**/*.styles.ts" ${fixArg}`);
|
|
30
|
+
consola.success('Stylelint completed');
|
|
31
|
+
}
|
|
32
|
+
} else {
|
|
33
|
+
throw new Error(`Unrecognized command: ${JSON.stringify(ctx.cli.options)}`);
|
|
29
34
|
}
|
|
30
35
|
};
|