@koslibs/configs 0.1.0 → 0.2.10

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.
@@ -1,74 +1,48 @@
1
- import path from 'node:path';
2
- import { fileURLToPath } from 'node:url';
3
-
4
- import { FlatCompat } from '@eslint/eslintrc';
5
1
  import js from '@eslint/js';
6
2
  import tsParser from '@typescript-eslint/parser';
7
- import prettier from 'eslint-plugin-prettier';
8
3
  import eslintConfigPrettier from 'eslint-config-prettier';
9
- import tseslint from 'typescript-eslint';
10
4
  import importPlugin from 'eslint-plugin-import-helpers';
11
- import { defineConfig, globalIgnores } from 'eslint/config';
5
+ import prettier from 'eslint-plugin-prettier';
12
6
  import globals from 'globals';
7
+ import tseslint from 'typescript-eslint';
13
8
 
14
- const __filename = fileURLToPath(import.meta.url);
15
- const __dirname = path.dirname(__filename);
16
- const compat = new FlatCompat({
17
- baseDirectory: __dirname,
18
- recommendedConfig: js.configs.recommended,
19
- allConfig: js.configs.all,
20
- });
21
-
22
- export default defineConfig([
23
- globalIgnores(['**/node_modules', '**/wailsjs', '**/dist', '**/vite.config.ts', '**/.cache']),
24
- js.configs.recommended,
25
- tseslint.configs.recommended,
26
- {
27
- files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.mjs', '**/*.cjs'],
9
+ import { globalIgnores } from './config.mjs';
28
10
 
29
- extends: compat.extends(
30
- 'plugin:@typescript-eslint/recommended',
31
- 'plugin:storybook/recommended'
32
- ),
11
+ const ignores = ['**/node_modules', '**/wailsjs', '**/dist', '**/.cache', '**/*.json'];
12
+ const files = ['**/*.{ts,tsx,js,jsx,mjs,cjs}'];
13
+ const prettierFiles = ['**/*.{ts,tsx,js,jsx,mjs,cjs,json}'];
33
14
 
15
+ export const baseEslintConfig = [
16
+ globalIgnores(ignores),
17
+ {
18
+ ...js.configs.recommended,
19
+ files,
20
+ },
21
+ ...tseslint.configs.recommended.map((config) => ({
22
+ ...config,
23
+ files: config.files ?? files,
24
+ })),
25
+ {
26
+ files,
34
27
  languageOptions: {
35
28
  globals: {
36
29
  ...globals.node,
37
30
  ...globals.browser,
38
31
  Controller: 'readonly',
39
32
  },
40
-
41
33
  parser: tsParser,
42
34
  ecmaVersion: 'latest',
43
35
  sourceType: 'module',
44
-
45
36
  parserOptions: {
46
37
  ecmaFeatures: {
47
38
  jsx: true,
48
39
  },
49
40
  sourceType: 'module',
50
- project: '../tsconfig/index.json',
51
- tsconfigRootDir: __dirname,
52
41
  },
53
42
  },
54
-
55
43
  plugins: {
56
- // @ts-ignore
57
44
  'import-helpers': importPlugin,
58
- js,
59
- },
60
-
61
- settings: {
62
- react: {
63
- version: 'detect',
64
- },
65
- 'import/resolver': {
66
- typescript: {
67
- alwaysTryTypes: true,
68
- },
69
- },
70
45
  },
71
-
72
46
  rules: {
73
47
  'import-helpers/order-imports': [
74
48
  'error',
@@ -78,7 +52,6 @@ export default defineConfig([
78
52
  alphabetize: { order: 'asc', ignoreCase: true },
79
53
  },
80
54
  ],
81
-
82
55
  'no-restricted-imports': [
83
56
  'error',
84
57
  {
@@ -119,11 +92,9 @@ export default defineConfig([
119
92
  'vm',
120
93
  'zlib',
121
94
  ],
122
-
123
95
  message: 'Use prefix node: for node packages',
124
96
  },
125
97
  ],
126
-
127
98
  paths: [
128
99
  {
129
100
  name: 'node:assert',
@@ -142,14 +113,12 @@ export default defineConfig([
142
113
  '@typescript-eslint/ban-ts-ignore': 'off',
143
114
  '@typescript-eslint/ban-ts-comment': 'off',
144
115
  '@typescript-eslint/no-explicit-any': 'error',
145
-
146
116
  '@typescript-eslint/no-empty-function': [
147
117
  'error',
148
118
  {
149
119
  allow: ['arrowFunctions'],
150
120
  },
151
121
  ],
152
-
153
122
  '@typescript-eslint/no-unused-vars': [
154
123
  'error',
155
124
  {
@@ -159,25 +128,12 @@ export default defineConfig([
159
128
  caughtErrorsIgnorePattern: '^error',
160
129
  },
161
130
  ],
162
-
163
- // '@typescript-eslint/ban-types': [
164
- // 'error',
165
- // {
166
- // extendDefaults: true,
167
-
168
- // types: {
169
- // '{}': false,
170
- // },
171
- // },
172
- // ],
173
-
174
131
  '@typescript-eslint/consistent-type-imports': [
175
132
  'error',
176
133
  {
177
134
  fixStyle: 'inline-type-imports',
178
135
  },
179
136
  ],
180
-
181
137
  'no-cond-assign': 'error',
182
138
  'no-control-regex': 'error',
183
139
  'no-debugger': 'error',
@@ -195,7 +151,6 @@ export default defineConfig([
195
151
  'no-unreachable': 'error',
196
152
  'no-unreachable-loop': 'error',
197
153
  'no-var': 'error',
198
-
199
154
  'no-multiple-empty-lines': [
200
155
  'error',
201
156
  {
@@ -203,16 +158,13 @@ export default defineConfig([
203
158
  maxEOF: 1,
204
159
  },
205
160
  ],
206
-
207
161
  'no-unsafe-negation': 'error',
208
-
209
162
  'no-console': [
210
163
  'error',
211
164
  {
212
165
  allow: ['info', 'error'],
213
166
  },
214
167
  ],
215
-
216
168
  'no-use-before-define': 'off',
217
169
  'no-shadow': 'off',
218
170
  'no-const-assign': 'error',
@@ -266,7 +218,6 @@ export default defineConfig([
266
218
  quotes: ['error', 'single'],
267
219
  'object-curly-spacing': [1, 'always'],
268
220
  'default-case': 'error',
269
-
270
221
  'comma-dangle': [
271
222
  'error',
272
223
  {
@@ -277,20 +228,16 @@ export default defineConfig([
277
228
  objects: 'always-multiline',
278
229
  },
279
230
  ],
280
-
281
231
  'max-params': [2, 6],
282
232
  'max-nested-callbacks': ['error', 3],
283
233
  'brace-style': 'error',
284
-
285
234
  camelcase: [
286
235
  'error',
287
236
  {
288
237
  properties: 'never',
289
238
  },
290
239
  ],
291
-
292
240
  'new-parens': 'error',
293
-
294
241
  'max-len': [
295
242
  'error',
296
243
  {
@@ -306,11 +253,12 @@ export default defineConfig([
306
253
  },
307
254
  },
308
255
  {
309
- files: ['**/*.ts', '**/*.tsx'],
256
+ files: prettierFiles,
310
257
  plugins: {
311
258
  prettier,
312
- // @ts-ignore
313
- rules: [
259
+ },
260
+ rules: {
261
+ 'prettier/prettier': [
314
262
  'error',
315
263
  {
316
264
  trailingComma: 'es5',
@@ -325,4 +273,6 @@ export default defineConfig([
325
273
  },
326
274
  },
327
275
  eslintConfigPrettier,
328
- ]);
276
+ ];
277
+
278
+ export default baseEslintConfig;
@@ -0,0 +1,11 @@
1
+ export const reactConfig = {
2
+ name: 'koslibs-lint/react',
3
+ settings: {
4
+ react: {
5
+ pragma: 'React',
6
+ version: 'detect',
7
+ },
8
+ },
9
+ };
10
+
11
+ export default reactConfig;
@@ -0,0 +1,4 @@
1
+ import { defineConfig } from './eslint/config.mjs';
2
+ import eslintConfig from './eslint/index.mjs';
3
+
4
+ export default defineConfig(eslintConfig);
package/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export { default as eslintConfig } from './eslint/index.mjs';
2
+ export { default as playwrightConfig } from './playwright/index.mjs';
3
+ export { default as prettierConfig } from './prettier/index.js';
4
+ export { default as viteConfig } from './vite/index.mjs';
5
+
6
+ export { createPlaywrightConfig } from './playwright/index.mjs';
7
+ export { createViteConfig } from './vite/index.mjs';
package/package.json CHANGED
@@ -1,21 +1,39 @@
1
1
  {
2
2
  "name": "@koslibs/configs",
3
- "version": "0.1.0",
3
+ "version": "0.2.10",
4
4
  "description": "Tool for api usage within react app",
5
- "main": "index.js",
5
+ "main": "./index.js",
6
6
  "private": false,
7
7
  "license": "MIT",
8
8
  "author": "holypower777",
9
9
  "type": "module",
10
+ "files": [
11
+ "cli",
12
+ "commitlint",
13
+ "eslint",
14
+ "playwright",
15
+ "prettier",
16
+ "rstest",
17
+ "shared",
18
+ "tsconfig",
19
+ "vite",
20
+ "index.js",
21
+ "eslint.config.mjs",
22
+ "LICENSE"
23
+ ],
24
+ "bin": {
25
+ "koslibs-lint": "cli/lint.js"
26
+ },
10
27
  "scripts": {
11
28
  "lint": "npm run lint:js && npm run format:check",
12
29
  "lint:fix": "npm run lint:js --fix && npm run format",
13
- "lint:js": "node ./cli/index.mjs js",
14
- "format": "node ./cli/index.mjs format",
15
- "format:check": "node ./cli/index.mjs format:check",
30
+ "lint:js": "node ./cli/lint.js js",
31
+ "format": "node ./cli/lint.js format",
32
+ "format:check": "node ./cli/lint.js format:check",
16
33
  "release": "changeset publish",
17
34
  "release:snapshot": "changeset publish --tag snapshot --no-git-tag",
18
35
  "version-package": "changeset version",
36
+ "version-package:patch": "npm version patch --no-git-tag-version",
19
37
  "version-package:snapshot": "changeset version --snapshot snapshot"
20
38
  },
21
39
  "bugs": {
@@ -24,7 +42,10 @@
24
42
  "homepage": "https://github.com/koslibs/configs",
25
43
  "repository": {
26
44
  "type": "git",
27
- "url": "https://github.com/koslibs/configs"
45
+ "url": "git+https://github.com/koslibs/configs.git"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
28
49
  },
29
50
  "engines": {
30
51
  "node": ">=22.14.0"
@@ -33,33 +54,49 @@
33
54
  "commitlint": {
34
55
  "extends": "./commitlint"
35
56
  },
36
- "eslintConfig": {
37
- "extends": "./eslint"
38
- },
39
57
  "exports": {
58
+ ".": "./index.js",
40
59
  "./eslint": "./eslint/index.mjs",
60
+ "./eslint/config": "./eslint/config.mjs",
61
+ "./eslint/react": "./eslint/react.mjs",
62
+ "./playwright": "./playwright/index.mjs",
41
63
  "./prettier": "./prettier/index.js",
42
- "./commitlint": "./commitlint/index.js"
64
+ "./rstest": {
65
+ "types": "./rstest/index.d.ts",
66
+ "default": "./rstest/index.mjs"
67
+ },
68
+ "./rstest/react": {
69
+ "types": "./rstest/react.d.ts",
70
+ "default": "./rstest/react.mjs"
71
+ },
72
+ "./commitlint": "./commitlint/index.js",
73
+ "./tsconfig": "./tsconfig/index.json",
74
+ "./tsconfig/base": "./tsconfig/base.json",
75
+ "./tsconfig/node": "./tsconfig/node.json",
76
+ "./vite": "./vite/index.mjs"
43
77
  },
44
78
  "dependencies": {
45
- "@commitlint/cli": "20.3.1",
46
79
  "@commitlint/config-conventional": "20.3.1",
47
- "@eslint/eslintrc": "3.3.1",
48
80
  "@eslint/js": "9.36.0",
81
+ "@rsbuild/plugin-react": "2.1.1",
82
+ "@rstest/core": "0.12.2",
83
+ "@typescript-eslint/parser": "8.44.0",
49
84
  "eslint": "9.36.0",
50
85
  "eslint-config-prettier": "10.1.8",
51
86
  "eslint-plugin-import-helpers": "2.0.1",
52
87
  "eslint-plugin-prettier": "5.5.4",
53
88
  "eslint-plugin-storybook": "0.11.2",
54
89
  "globals": "16.4.0",
55
- "lefthook": "2.0.13",
90
+ "happy-dom": "20.14.5",
56
91
  "prettier": "3.6.2",
57
92
  "typescript": "5.7.2",
58
93
  "typescript-eslint": "8.44.0"
59
94
  },
60
95
  "devDependencies": {
61
- "@changesets/changelog-github": "^0.5.2",
62
- "@changesets/cli": "^2.29.8",
63
- "@types/node": "^24.4.0"
96
+ "@changesets/changelog-github": "0.5.2",
97
+ "@changesets/cli": "2.29.8",
98
+ "@commitlint/cli": "20.3.1",
99
+ "@types/node": "24.10.4",
100
+ "lefthook": "2.0.13"
64
101
  }
65
102
  }
@@ -0,0 +1,23 @@
1
+ import mergeConfig from '../shared/merge-config.mjs';
2
+
3
+ const defaultReporter = process.env.CI
4
+ ? [['github'], ['html', { open: 'never' }]]
5
+ : [['html', { open: 'never' }]];
6
+
7
+ export const playwrightConfig = {
8
+ testDir: './playwright',
9
+ fullyParallel: true,
10
+ forbidOnly: Boolean(process.env.CI),
11
+ retries: process.env.CI ? 2 : 0,
12
+ workers: process.env.CI ? 1 : undefined,
13
+ reporter: defaultReporter,
14
+ use: {
15
+ trace: 'on-first-retry',
16
+ screenshot: 'only-on-failure',
17
+ video: 'retain-on-failure',
18
+ },
19
+ };
20
+
21
+ export const createPlaywrightConfig = (overrides = {}) => mergeConfig(playwrightConfig, overrides);
22
+
23
+ export default playwrightConfig;
@@ -0,0 +1,67 @@
1
+ # Rstest presets
2
+
3
+ ## Libraries (Node environment)
4
+
5
+ Install `@koslibs/configs` as a development dependency, then create `rstest.config.mjs`.
6
+ The package installs pinned versions of Rstest and its preset dependencies:
7
+
8
+ ```js
9
+ import { createRstestConfig } from '@koslibs/configs/rstest';
10
+
11
+ export default createRstestConfig({
12
+ include: ['src/**/*.test.ts'],
13
+ });
14
+ ```
15
+
16
+ ## React applications and component libraries
17
+
18
+ The React plugin and `happy-dom` are included in `@koslibs/configs` dependencies.
19
+ React and React DOM belong to the consuming project.
20
+
21
+ ```js
22
+ import { createReactRstestConfig } from '@koslibs/configs/rstest/react';
23
+
24
+ export default createReactRstestConfig({
25
+ include: ['src/**/*.test.{ts,tsx}'],
26
+ setupFiles: ['./rstest.setup.ts'],
27
+ });
28
+ ```
29
+
30
+ The React preset enables JSX through the React plugin and uses a simulated DOM.
31
+ It does not run browser, screenshot or Playwright tests. Keep their file patterns
32
+ separate from unit tests using `include` / `exclude` in the consuming project.
33
+
34
+ For Testing Library, install `@testing-library/react` and
35
+ `@testing-library/jest-dom` and create the optional setup file:
36
+
37
+ ```ts
38
+ import { afterEach, expect } from '@rstest/core';
39
+ import { cleanup } from '@testing-library/react';
40
+ import * as matchers from '@testing-library/jest-dom/matchers';
41
+
42
+ expect.extend(matchers);
43
+ afterEach(() => cleanup());
44
+ ```
45
+
46
+ ## Defaults and overrides
47
+
48
+ Both presets use explicit test imports (`globals: false`), clear mock histories,
49
+ restore spies between tests and fail when no tests are found. Coverage is opt-in
50
+ with `rstest run --coverage`; reports use text, HTML and LCOV. No coverage threshold
51
+ or automatic retry is imposed. Use `rstest run` in CI and `rstest` locally.
52
+
53
+ Factories follow the shared configuration merge convention: nested objects merge,
54
+ arrays append, and scalar values override. Additional React plugins append after
55
+ the built-in React plugin. Paths are relative to the consuming project. Configure
56
+ aliases, setup files, test patterns and coverage thresholds locally.
57
+
58
+ Rstest, the React plugin and `happy-dom` are installed for every consumer, with
59
+ exact versions managed by `@koslibs/configs`. Import the React preset through
60
+ `/rstest/react` explicitly. Package managers with strict dependency isolation may
61
+ still require a direct `@rstest/core` dependency when tests import from it or
62
+ project scripts invoke its CLI; use the same version declared by this package.
63
+
64
+ Types are verified with TypeScript's `moduleResolution: "Bundler"`. With the tested
65
+ Rstest 0.12.2 dependency tree, `NodeNext` and `skipLibCheck: false` report TS1479 in
66
+ Rsbuild's bundled plugin declarations. For configuration files using NodeNext,
67
+ `skipLibCheck: true` avoids checking those third-party declarations.
@@ -0,0 +1,5 @@
1
+ import type { RstestConfig } from '@rstest/core';
2
+
3
+ export declare const rstestConfig: RstestConfig;
4
+ export declare const createRstestConfig: (overrides?: RstestConfig) => RstestConfig;
5
+ export default rstestConfig;
@@ -0,0 +1,16 @@
1
+ import mergeConfig from '../shared/merge-config.mjs';
2
+
3
+ export const rstestConfig = {
4
+ testEnvironment: 'node',
5
+ globals: false,
6
+ clearMocks: true,
7
+ restoreMocks: true,
8
+ passWithNoTests: false,
9
+ coverage: {
10
+ reporters: ['text', 'html', 'lcov'],
11
+ },
12
+ };
13
+
14
+ export const createRstestConfig = (overrides = {}) => mergeConfig(rstestConfig, overrides);
15
+
16
+ export default rstestConfig;
@@ -0,0 +1,5 @@
1
+ import type { RstestConfig } from '@rstest/core';
2
+
3
+ export declare const reactRstestConfig: RstestConfig;
4
+ export declare const createReactRstestConfig: (overrides?: RstestConfig) => RstestConfig;
5
+ export default reactRstestConfig;
@@ -0,0 +1,14 @@
1
+ import { pluginReact } from '@rsbuild/plugin-react';
2
+
3
+ import { createRstestConfig } from './index.mjs';
4
+
5
+ export const createReactRstestConfig = (overrides = {}) =>
6
+ createRstestConfig({
7
+ testEnvironment: 'happy-dom',
8
+ ...overrides,
9
+ plugins: [pluginReact(), ...(overrides.plugins ?? [])],
10
+ });
11
+
12
+ export const reactRstestConfig = createReactRstestConfig();
13
+
14
+ export default reactRstestConfig;
@@ -0,0 +1,41 @@
1
+ const isPlainObject = (value) => Object.prototype.toString.call(value) === '[object Object]';
2
+
3
+ const cloneValue = (value) => {
4
+ if (Array.isArray(value)) {
5
+ return value.map(cloneValue);
6
+ }
7
+
8
+ if (isPlainObject(value)) {
9
+ return Object.fromEntries(
10
+ Object.entries(value).map(([key, nestedValue]) => [key, cloneValue(nestedValue)])
11
+ );
12
+ }
13
+
14
+ return value;
15
+ };
16
+
17
+ const mergeValue = (target, source) => {
18
+ if (Array.isArray(target) && Array.isArray(source)) {
19
+ return [...target, ...source];
20
+ }
21
+
22
+ if (isPlainObject(target) && isPlainObject(source)) {
23
+ const nextValue = { ...target };
24
+
25
+ for (const [key, nestedValue] of Object.entries(source)) {
26
+ nextValue[key] =
27
+ key in nextValue
28
+ ? mergeValue(nextValue[key], nestedValue)
29
+ : cloneValue(nestedValue);
30
+ }
31
+
32
+ return nextValue;
33
+ }
34
+
35
+ return cloneValue(source);
36
+ };
37
+
38
+ export const mergeConfig = (...parts) =>
39
+ parts.filter(Boolean).reduce((mergedValue, part) => mergeValue(mergedValue, part), {});
40
+
41
+ export default mergeConfig;
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "allowJs": false,
6
+ "skipLibCheck": true,
7
+ "esModuleInterop": false,
8
+ "allowSyntheticDefaultImports": true,
9
+ "strict": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "resolveJsonModule": true,
12
+ "isolatedModules": true,
13
+ "noEmit": true
14
+ }
15
+ }
@@ -1,29 +1,9 @@
1
1
  {
2
+ "extends": "./base.json",
2
3
  "compilerOptions": {
3
- "target": "ESNext",
4
- "useDefineForClassFields": true,
5
4
  "lib": ["DOM", "DOM.Iterable", "ESNext"],
6
- "allowJs": false,
7
- "skipLibCheck": true,
8
- "esModuleInterop": false,
9
- "allowSyntheticDefaultImports": true,
10
- "strict": true,
11
- "forceConsistentCasingInFileNames": true,
12
5
  "module": "ESNext",
13
- "moduleResolution": "Node",
14
- "resolveJsonModule": true,
15
- "isolatedModules": true,
16
- "noEmit": true,
6
+ "moduleResolution": "Bundler",
17
7
  "jsx": "react-jsx"
18
- },
19
- "include": [
20
- "src",
21
- ".storybook/**/*",
22
- "eslint.config.mjs",
23
- "prettier.config.mjs",
24
- "playwright/**/*.tsx",
25
- "playwright-ct.config.ts",
26
- "playwright.config.ts",
27
- "**/*.spec.tsx"
28
- ]
8
+ }
29
9
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./base.json",
3
+ "compilerOptions": {
4
+ "lib": ["ES2022"],
5
+ "module": "NodeNext",
6
+ "moduleResolution": "NodeNext",
7
+ "types": ["node"]
8
+ }
9
+ }
package/vite/index.mjs ADDED
@@ -0,0 +1,18 @@
1
+ import mergeConfig from '../shared/merge-config.mjs';
2
+
3
+ export const viteConfig = {
4
+ server: {
5
+ host: true,
6
+ port: 5173,
7
+ strictPort: true,
8
+ },
9
+ preview: {
10
+ host: true,
11
+ port: 4173,
12
+ strictPort: true,
13
+ },
14
+ };
15
+
16
+ export const createViteConfig = (overrides = {}) => mergeConfig(viteConfig, overrides);
17
+
18
+ export default viteConfig;
@@ -1,8 +0,0 @@
1
- # Changesets
2
-
3
- Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4
- with multi-package repos, or single-package repos to help you version and publish your code. You can
5
- find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6
-
7
- We have a quick list of common questions to get you started engaging with this project in
8
- [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
@@ -1,15 +0,0 @@
1
- {
2
- "$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
3
- "changelog": ["@changesets/changelog-github", { "repo": "koslibs/configs" }],
4
- "commit": false,
5
- "fixed": [],
6
- "linked": [],
7
- "access": "public",
8
- "baseBranch": "main",
9
- "updateInternalDependencies": "patch",
10
- "ignore": [],
11
- "snapshot": {
12
- "prereleaseTemplate": "{tag}-{commit}",
13
- "useCalculatedVersion": true
14
- }
15
- }
package/eslint.config.js DELETED
@@ -1,4 +0,0 @@
1
- import { defineConfig } from './eslint/config';
2
- import { eslintConfig } from './eslint';
3
-
4
- export default defineConfig(eslintConfig);
@@ -1,16 +0,0 @@
1
- # Refer for explanation to following link:
2
- # https://lefthook.dev/configuration/
3
-
4
- pre-commit:
5
- parallel: true
6
- commands:
7
- check-scripts:
8
- glob: '*.{js,ts,jsx,tsx,mts,mjs,cjs,cts,ctsx,mtsx,cjsx,mjsx}'
9
- run: npx --no-install prettier --write {staged_files} --cache && npx --no-install eslint {staged_files} --no-warn-ignored && git add {staged_files}
10
- check-json:
11
- glob: '*.{json}'
12
- run: npx --no-install prettier --write {staged_files} --cache && git add {staged_files}
13
- commit-msg:
14
- commands:
15
- commitlint:
16
- run: npx --no-install commitlint --edit {1}
File without changes
File without changes