@naturalcycles/dev-lib 13.20.2 → 13.21.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.
@@ -73,9 +73,6 @@ const linters = {
73
73
  return [prettierCmd].map(s => `${s} ${filesList}`)
74
74
  },
75
75
 
76
- // CircleCI config (if modified)
77
- [`./.circleci/config.yml`]: ['./node_modules/.bin/lint-circleci'],
78
-
79
76
  '**/*.{kt,kts}': match => {
80
77
  const filesList = micromatch.not(match, lintExclude).join(' ')
81
78
  if (!filesList) return []
@@ -24,9 +24,11 @@ async function lintAllCommand() {
24
24
  }).argv;
25
25
  const hadChangesBefore = await (0, git_util_1.gitHasUncommittedChanges)();
26
26
  await (0, eslint_all_command_1.eslintAllCommand)();
27
- await (0, stylelint_util_1.stylelintAll)();
27
+ if (fs.existsSync(`node_modules/stylelint`) &&
28
+ fs.existsSync(`node_modules/stylelint-config-standard-scss`)) {
29
+ await (0, stylelint_util_1.stylelintAll)();
30
+ }
28
31
  await (0, prettier_util_1.runPrettier)();
29
- // Running ktlintAll (experimental!)
30
32
  if (fs.existsSync(`node_modules/@naturalcycles/ktlint`)) {
31
33
  const ktlintLib = require('@naturalcycles/ktlint');
32
34
  await ktlintLib.ktlintAll();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
- "version": "13.20.2",
3
+ "version": "13.21.1",
4
4
  "scripts": {
5
5
  "prepare": "husky install",
6
6
  "tsn-debug": "tsn testScript.ts",
@@ -24,7 +24,6 @@
24
24
  "prettier-all": "tsn ./src/bin/prettier-all.ts",
25
25
  "stylelint-all": "tsn ./src/bin/stylelint-all.ts",
26
26
  "lint-all": "tsn ./src/bin/lint-all.ts",
27
- "lint-circleci": "tsn ./src/bin/lint-circleci.ts",
28
27
  "eslint-all": "tsn ./src/bin/eslint-all.ts",
29
28
  "eslint-print-config": "eslint --print-config src/index.ts > tmp/eslint.config.json",
30
29
  "update-from-dev-lib": "tsn ./src/bin/update-from-dev-lib.ts"
@@ -41,7 +40,6 @@
41
40
  "@types/yargs": "^16.0.0",
42
41
  "@typescript-eslint/eslint-plugin": "^5.0.0",
43
42
  "@typescript-eslint/parser": "^5.0.0",
44
- "command-exists": "^1.2.8",
45
43
  "eslint": "^8.0.0",
46
44
  "eslint-config-prettier": "^8.3.0",
47
45
  "eslint-plugin-import": "^2.22.1",
@@ -58,15 +56,15 @@
58
56
  "lint-staged": "^13.0.0",
59
57
  "mitm": "^1.7.0",
60
58
  "prettier": "^2.0.4",
61
- "stylelint": "^15.0.0",
62
- "stylelint-config-standard-scss": "^7.0.0",
63
59
  "timekeeper": "^2.2.0",
64
60
  "ts-jest": "^29.0.0",
65
61
  "typescript": "^4.0.2",
66
62
  "yargs": "^17.0.0"
67
63
  },
68
64
  "devDependencies": {
69
- "jest": "^29.0.0"
65
+ "jest": "^29.0.0",
66
+ "stylelint": "^15.0.0",
67
+ "stylelint-config-standard-scss": "^7.0.0"
70
68
  },
71
69
  "files": [
72
70
  "dist",
@@ -88,7 +86,6 @@
88
86
  "generate-build-info": "dist/bin/generate-build-info.js",
89
87
  "init-from-dev-lib": "dist/bin/init-from-dev-lib.js",
90
88
  "lint-all": "dist/bin/lint-all.js",
91
- "lint-circleci": "dist/bin/lint-circleci.js",
92
89
  "lint-staged-def": "dist/bin/lint-staged-def.js",
93
90
  "prettier-all": "dist/bin/prettier-all.js",
94
91
  "stylelint-all": "dist/bin/stylelint-all.js",
package/readme.md CHANGED
@@ -145,8 +145,6 @@ If you need to execute shards **in parallel**, you can follow e.g
145
145
  - `eslint-all`: runs `eslint` on needed paths
146
146
  - `stylelint-all`: runs `stylelint` on needed paths
147
147
  - `prettier-all`: runs just Prettier on needed paths
148
- - `lint-circleci`: fails if `.circleci/config.yml` is invalid
149
- ([CircleCI CLI](https://circleci.com/docs/2.0/local-cli/) must be installed before)
150
148
 
151
149
  Pass `--no-fix` (or `--fix=false`) to disable the default `--fix` flag on linters. Useful to debug a
152
150
  linter, or when linter behaves badly and corrupts your files (just happened to me with
@@ -155,6 +153,10 @@ linter, or when linter behaves badly and corrupts your files (just happened to m
155
153
  Pass `--ext` (e.g `--ext ts,html`) to override the list of ESLint extensions (default is
156
154
  `ts,tsx,vue` right now).
157
155
 
156
+ For Stylelint to be run, you need to manually install it in the target project:
157
+
158
+ `yarn add -D stylelint stylelint-config-standard-scss`
159
+
158
160
  ##### ktlint
159
161
 
160
162
  `ktlint` will be used by lint-staged for all `**/*.{kt,kts}` files.
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const script_1 = require("@naturalcycles/nodejs-lib/dist/script");
5
- const lint_circleci_command_1 = require("../cmd/lint-circleci.command");
6
- (0, script_1.runScript)(lint_circleci_command_1.lintCircleCICommand);
@@ -1 +0,0 @@
1
- export declare function lintCircleCICommand(): Promise<void>;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lintCircleCICommand = void 0;
4
- const colors_1 = require("@naturalcycles/nodejs-lib/dist/colors");
5
- const exec_1 = require("@naturalcycles/nodejs-lib/dist/exec");
6
- async function lintCircleCICommand() {
7
- const commandExistsSync = require('command-exists').sync;
8
- if (!commandExistsSync('circleci')) {
9
- // Cannot validate, cause `circleci` binary is not installed
10
- console.warn(`!!\n!! Please install ${(0, colors_1.boldGrey)('circleci')} CLI to validate ${(0, colors_1.boldGrey)('config.yml')}\n!!\n!! https://circleci.com/docs/2.0/local-cli/\n!!`);
11
- return process.exit(5);
12
- }
13
- await (0, exec_1.execWithArgs)('circleci', ['config', 'validate']);
14
- }
15
- exports.lintCircleCICommand = lintCircleCICommand;