Skip to content

Commit f251b22

Browse files
committed
feat: support skiplint for test command
1 parent 53c3e19 commit f251b22

3 files changed

Lines changed: 20 additions & 8 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pri",
3-
"version": "4.0.20-beta.1",
3+
"version": "4.0.20",
44
"types": "src/node/index.ts",
55
"main": "built/node/index.js",
66
"scripts": {

src/built-in-plugins/command-test/plugin/index.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as path from 'path';
22
import { pri } from '../../../node';
33
import { testsPath } from '../../../utils/structor-config';
44
import { typeChecker } from '../../../utils/type-checker';
5+
import { IOpts } from './interface';
56

67
pri.project.whiteFileRules.add(file => {
78
return path.format(file).startsWith(path.join(pri.projectRootPath, testsPath.dir));
@@ -16,13 +17,21 @@ pri.packages.forEach(eachPackage => {
1617
pri.commands.registerCommand({
1718
name: ['test'],
1819
description: 'Run tests.',
19-
action: async () => {
20-
await pri.project.lint({
21-
lintAll: false,
22-
needFix: true,
23-
showBreakError: true,
24-
});
25-
typeChecker();
20+
options: {
21+
skipLint: {
22+
description: 'Skip lint',
23+
},
24+
},
25+
action: async (options: IOpts) => {
26+
if (!options.skipLint) {
27+
await pri.project.lint({
28+
lintAll: false,
29+
needFix: true,
30+
showBreakError: true,
31+
});
32+
typeChecker();
33+
}
34+
2635
await pri.project.ensureProjectFiles();
2736
await pri.project.checkProjectFiles();
2837

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export interface IOpts {
2+
skipLint?: boolean;
3+
}

0 commit comments

Comments
 (0)