@xylabs/ts-scripts-yarn3 2.16.4 → 2.17.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/.tsconfig.build.cjs.tsbuildinfo +1 -1
- package/dist/.tsconfig.build.esm.tsbuildinfo +1 -1
- package/dist/cjs/actions/lint-clean.js +2 -1
- package/dist/cjs/actions/lint-clean.js.map +1 -1
- package/dist/cjs/actions/lint-profile.js +1 -1
- package/dist/cjs/actions/lint-profile.js.map +1 -1
- package/dist/cjs/actions/lint.js +20 -7
- package/dist/cjs/actions/lint.js.map +1 -1
- package/dist/cjs/lib/xy/xyLintCommands.js +4 -3
- package/dist/cjs/lib/xy/xyLintCommands.js.map +1 -1
- package/dist/cjs/lib/xy/xyParseOptions.js +1 -0
- package/dist/cjs/lib/xy/xyParseOptions.js.map +1 -1
- package/dist/esm/actions/lint-clean.js +3 -2
- package/dist/esm/actions/lint-clean.js.map +1 -1
- package/dist/esm/actions/lint-profile.js +1 -1
- package/dist/esm/actions/lint-profile.js.map +1 -1
- package/dist/esm/actions/lint.js +16 -4
- package/dist/esm/actions/lint.js.map +1 -1
- package/dist/esm/lib/xy/xyLintCommands.js +2 -2
- package/dist/esm/lib/xy/xyLintCommands.js.map +1 -1
- package/dist/esm/lib/xy/xyParseOptions.js +1 -0
- package/dist/esm/lib/xy/xyParseOptions.js.map +1 -1
- package/dist/tsconfig.build.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.build.esm.tsbuildinfo +1 -1
- package/dist/types/actions/gitlint.d.ts +1 -1
- package/dist/types/actions/lint-clean.d.ts +1 -1
- package/dist/types/actions/lint-clean.d.ts.map +1 -1
- package/dist/types/actions/lint.d.ts +3 -2
- package/dist/types/actions/lint.d.ts.map +1 -1
- package/dist/types/actions/package/copy-assets.d.ts +1 -1
- package/dist/types/lib/dependencies/DuplicateDetector.d.ts +1 -1
- package/dist/types/lib/withErrnoException.d.ts +0 -1
- package/dist/types/lib/withErrnoException.d.ts.map +1 -1
- package/dist/types/lib/xy/xyParseOptions.d.ts.map +1 -1
- package/package.json +13 -12
- package/src/actions/lint-clean.ts +3 -2
- package/src/actions/lint-profile.ts +1 -1
- package/src/actions/lint.ts +26 -4
- package/src/lib/xy/xyLintCommands.ts +2 -2
- package/src/lib/xy/xyParseOptions.ts +1 -0
- package/tsconfig.build.cjs.json +7 -7
- package/tsconfig.build.esm.json +7 -7
- package/.tsconfig.build.test.json +0 -6
package/src/actions/lint.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
|
+
import { ESLint } from 'eslint'
|
|
2
3
|
|
|
3
4
|
import { runSteps, yarnWorkspaces } from '../lib'
|
|
4
5
|
|
|
@@ -12,15 +13,36 @@ export interface LintPackageParams {
|
|
|
12
13
|
verbose?: boolean
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
export const lintPackage = ({ pkg }: LintParams) => {
|
|
16
|
+
export const lintPackage = async ({ pkg }: LintParams) => {
|
|
16
17
|
const workspace = yarnWorkspaces().find((workspace) => workspace.name === pkg)
|
|
17
18
|
if (!workspace) {
|
|
18
19
|
console.error(chalk.red(`Unable to locate package [${chalk.magenta(pkg)}]`))
|
|
19
20
|
process.exit(1)
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
|
|
23
|
+
const engine = new ESLint({ cache: true })
|
|
24
|
+
|
|
25
|
+
const lintResults = await engine.lintFiles(workspace.location)
|
|
26
|
+
|
|
27
|
+
console.log(lintResults)
|
|
28
|
+
|
|
29
|
+
const errorCount = lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0)
|
|
30
|
+
|
|
31
|
+
return errorCount
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const lintAll = async () => {
|
|
35
|
+
const engine = new ESLint({ cache: true })
|
|
36
|
+
|
|
37
|
+
const lintResults = await engine.lintFiles('./**/*.*')
|
|
38
|
+
|
|
39
|
+
console.log(lintResults)
|
|
40
|
+
|
|
41
|
+
const errorCount = lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0)
|
|
42
|
+
|
|
43
|
+
return errorCount
|
|
22
44
|
}
|
|
23
45
|
|
|
24
|
-
export const lint = ({ pkg }: LintParams) => {
|
|
25
|
-
return pkg ? lintPackage({ pkg }) : runSteps('Lint-Caching [All]', [['yarn', ['eslint', '.', '--cache']]])
|
|
46
|
+
export const lint = async ({ pkg }: LintParams = {}) => {
|
|
47
|
+
return pkg ? await lintPackage({ pkg }) : runSteps('Lint-Caching [All]', [['yarn', ['eslint', '.', '--cache']]])
|
|
26
48
|
}
|
|
@@ -25,9 +25,9 @@ export const xyLintCommands = (args: yargs.Argv) => {
|
|
|
25
25
|
describe: 'Specific package to check',
|
|
26
26
|
})
|
|
27
27
|
},
|
|
28
|
-
(argv) => {
|
|
28
|
+
async (argv) => {
|
|
29
29
|
if (argv.verbose) console.log('Lint')
|
|
30
|
-
process.exitCode = argv.fix ? fix() : argv.profile ? lintProfile() : lint({ pkg: argv.package as string })
|
|
30
|
+
process.exitCode = argv.fix ? fix() : argv.profile ? lintProfile() : await lint({ pkg: argv.package as string })
|
|
31
31
|
},
|
|
32
32
|
)
|
|
33
33
|
.command(
|
package/tsconfig.build.cjs.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"rootDir": "src",
|
|
4
|
-
"rootDirs": [
|
|
5
|
-
"package.json"
|
|
6
|
-
],
|
|
7
3
|
"composite": true,
|
|
8
4
|
"declarationDir": "./dist/types",
|
|
9
|
-
"typeRoots": [],
|
|
10
5
|
"module": "CommonJS",
|
|
11
6
|
"outDir": "./dist/cjs",
|
|
12
|
-
"
|
|
7
|
+
"rootDir": "src",
|
|
8
|
+
"rootDirs": [
|
|
9
|
+
"package.json"
|
|
10
|
+
],
|
|
11
|
+
"target": "ES6",
|
|
12
|
+
"typeRoots": []
|
|
13
13
|
},
|
|
14
|
-
"extends": "@xylabs/tsconfig",
|
|
15
14
|
"exclude": [
|
|
16
15
|
"**/build",
|
|
17
16
|
"**/dist",
|
|
@@ -23,6 +22,7 @@
|
|
|
23
22
|
"**/spec/*",
|
|
24
23
|
"**/stories/*"
|
|
25
24
|
],
|
|
25
|
+
"extends": "@xylabs/tsconfig",
|
|
26
26
|
"include": [
|
|
27
27
|
"src"
|
|
28
28
|
]
|
package/tsconfig.build.esm.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"rootDir": "src",
|
|
4
|
-
"rootDirs": [
|
|
5
|
-
"package.json"
|
|
6
|
-
],
|
|
7
3
|
"composite": true,
|
|
8
4
|
"declarationDir": "./dist/types",
|
|
9
|
-
"typeRoots": [],
|
|
10
5
|
"module": "ESNext",
|
|
11
6
|
"outDir": "./dist/esm",
|
|
12
|
-
"
|
|
7
|
+
"rootDir": "src",
|
|
8
|
+
"rootDirs": [
|
|
9
|
+
"package.json"
|
|
10
|
+
],
|
|
11
|
+
"target": "ESNext",
|
|
12
|
+
"typeRoots": []
|
|
13
13
|
},
|
|
14
|
-
"extends": "@xylabs/tsconfig",
|
|
15
14
|
"exclude": [
|
|
16
15
|
"**/build",
|
|
17
16
|
"**/dist",
|
|
@@ -23,6 +22,7 @@
|
|
|
23
22
|
"**/spec/*",
|
|
24
23
|
"**/stories/*"
|
|
25
24
|
],
|
|
25
|
+
"extends": "@xylabs/tsconfig",
|
|
26
26
|
"include": [
|
|
27
27
|
"src"
|
|
28
28
|
]
|