@zairakai/js-dev-tools 3.4.4 → 3.5.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/README.md CHANGED
@@ -27,6 +27,7 @@ One unified toolkit to set up JavaScript/TypeScript quality tooling. Context-awa
27
27
  | **Concentrated Configs** | Centralized, opinionated configurations for all your tools. Avoid configuration drift across projects. |
28
28
  | **Unified Workflow** | One set of `make` commands to rule them all. Whether it's a small library or a large application, the quality gate remains the same. |
29
29
  | **Auto-Syncing CI** | Automatically updates GitLab CI ref tags in your `.gitlab-ci.yml` when you update the package. Keep your pipelines current without manual effort. |
30
+ | **Shared base** | The ESLint, Prettier, Stylelint, Vitest, TypeScript and markdownlint rules live in [`@stanislas-poisson/js-dev-tools`](https://github.com/Stanislas-Poisson/js-dev-tools), which this package requires. The paths of this package (`@zairakai/js-dev-tools/eslint`, `/prettier`, ...) stay the same. |
30
31
  | **Zero Friction** | Automated setup script handles the heavy lifting on install. |
31
32
 
32
33
  ---
@@ -1,7 +1,3 @@
1
1
  {
2
- "default": true,
3
- "MD013": false,
4
- "MD024": {
5
- "siblings_only": true
6
- }
2
+ "extends": "@stanislas-poisson/js-dev-tools/config/.markdownlint.json"
7
3
  }
@@ -1,247 +1,2 @@
1
- /**
2
- * Default ESLint configuration for @zairakai projects.
3
- */
4
- import { includeIgnoreFile } from '@eslint/compat'
5
- import pluginJs from '@eslint/js'
6
- import pluginTypeScript from '@typescript-eslint/eslint-plugin'
7
- import parserTypeScript from '@typescript-eslint/parser'
8
- import eslintConfigPrettier from 'eslint-config-prettier'
9
- import pluginVue from 'eslint-plugin-vue'
10
- import globals from 'globals'
11
- import { existsSync } from 'node:fs'
12
- import path from 'node:path'
13
-
14
- const gitignorePath = path.resolve(process.cwd(), '.gitignore')
15
- const gitignoreConfig = existsSync(gitignorePath) ? [includeIgnoreFile(gitignorePath)] : []
16
-
17
- export default [
18
- ...gitignoreConfig,
19
-
20
- // Base JavaScript rules
21
- pluginJs.configs.recommended,
22
-
23
- // Vue flat config (sets up vue-eslint-parser as the Vue file parser)
24
- ...pluginVue.configs['flat/strongly-recommended'],
25
-
26
- // Base configuration for all files
27
- {
28
- languageOptions: {
29
- globals: {
30
- ...globals.browser,
31
- ...globals.node,
32
- ...globals.es2022,
33
- },
34
- parserOptions: {
35
- ecmaVersion: 'latest',
36
- sourceType: 'module',
37
- },
38
- },
39
- rules: {
40
- // Yoda style enforcement (Zairakai convention)
41
- yoda: [
42
- 'error',
43
- 'always',
44
- {
45
- exceptRange: true,
46
- onlyEquality: false,
47
- },
48
- ],
49
-
50
- // Code quality
51
- 'no-unused-vars': [
52
- 'error',
53
- {
54
- argsIgnorePattern: '^_',
55
- varsIgnorePattern: '^_',
56
- caughtErrorsIgnorePattern: '^_',
57
- },
58
- ],
59
- 'no-unused-expressions': [
60
- 'error',
61
- {
62
- allowShortCircuit: true,
63
- allowTernary: true,
64
- allowTaggedTemplates: true,
65
- },
66
- ],
67
- 'no-console': [
68
- 'warn',
69
- {
70
- allow: ['warn', 'error', 'info', 'debug'],
71
- },
72
- ],
73
- 'no-debugger': 'error',
74
-
75
- // Best practices
76
- eqeqeq: [
77
- 'error',
78
- 'always',
79
- {
80
- null: 'ignore',
81
- },
82
- ],
83
- curly: ['error', 'all'],
84
- 'prefer-const': 'error',
85
- 'no-var': 'error',
86
- 'object-shorthand': 'error',
87
- 'prefer-template': 'error',
88
- 'prefer-arrow-callback': 'error',
89
-
90
- // Import rules
91
- 'sort-imports': [
92
- 'error',
93
- {
94
- ignoreDeclarationSort: true,
95
- ignoreMemberSort: false,
96
- memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
97
- },
98
- ],
99
-
100
- // Vue specific rules (relaxed for flexibility)
101
- 'vue/multi-word-component-names': 'off',
102
- 'vue/require-default-prop': 'off',
103
- 'vue/valid-template-root': 'off',
104
- 'vue/no-v-html': 'warn',
105
- 'vue/require-v-for-key': 'error',
106
- 'vue/no-unused-components': 'warn',
107
- 'vue/component-name-in-template-casing': ['error', 'PascalCase'],
108
- 'vue/attribute-hyphenation': ['error', 'always'],
109
- 'vue/v-on-event-hyphenation': ['error', 'always'],
110
- },
111
- },
112
-
113
- // TypeScript configuration for .ts / .tsx files
114
- {
115
- files: ['**/*.ts', '**/*.tsx'],
116
- languageOptions: {
117
- parser: parserTypeScript,
118
- parserOptions: {
119
- project: './tsconfig.json',
120
- },
121
- },
122
- plugins: {
123
- '@typescript-eslint': pluginTypeScript,
124
- },
125
- rules: {
126
- 'no-unused-vars': 'off',
127
- 'no-undef': 'off',
128
- '@typescript-eslint/no-unused-vars': [
129
- 'error',
130
- {
131
- argsIgnorePattern: '^_',
132
- varsIgnorePattern: '^_',
133
- caughtErrorsIgnorePattern: '^_',
134
- },
135
- ],
136
- '@typescript-eslint/no-explicit-any': 'warn',
137
- '@typescript-eslint/explicit-function-return-type': 'off',
138
- '@typescript-eslint/explicit-module-boundary-types': 'off',
139
- '@typescript-eslint/prefer-nullish-coalescing': [
140
- 'error',
141
- {
142
- // Boolean OR (e.g. combining two route-guard flags) is not the same
143
- // operation as null-coalescing: `??` only falls through on
144
- // null/undefined, so `false ?? true` stays `false` where
145
- // `false || true` correctly yields `true`. Forcing `??` here would
146
- // silently break any logic relying on an explicit `false`.
147
- ignorePrimitives: { boolean: true },
148
- },
149
- ],
150
- '@typescript-eslint/prefer-optional-chain': 'error',
151
- '@typescript-eslint/no-non-null-assertion': 'warn',
152
- },
153
- },
154
-
155
- // TypeScript configuration for .vue files
156
- // vue-eslint-parser (set by pluginVue above) must remain the primary parser.
157
- // TypeScript parser is passed as parserOptions.parser for <script> blocks only.
158
- {
159
- files: ['**/*.vue'],
160
- languageOptions: {
161
- parserOptions: {
162
- parser: parserTypeScript,
163
- project: './tsconfig.json',
164
- extraFileExtensions: ['.vue'],
165
- },
166
- },
167
- plugins: {
168
- '@typescript-eslint': pluginTypeScript,
169
- },
170
- rules: {
171
- 'no-unused-vars': 'off',
172
- 'no-undef': 'off',
173
- '@typescript-eslint/no-unused-vars': [
174
- 'error',
175
- {
176
- argsIgnorePattern: '^_',
177
- varsIgnorePattern: '^_',
178
- caughtErrorsIgnorePattern: '^_',
179
- },
180
- ],
181
- '@typescript-eslint/no-explicit-any': 'warn',
182
- '@typescript-eslint/explicit-function-return-type': 'off',
183
- '@typescript-eslint/explicit-module-boundary-types': 'off',
184
- '@typescript-eslint/prefer-nullish-coalescing': [
185
- 'error',
186
- {
187
- // See the .ts block above for why boolean operands are exempted.
188
- ignorePrimitives: { boolean: true },
189
- },
190
- ],
191
- '@typescript-eslint/prefer-optional-chain': 'error',
192
- '@typescript-eslint/no-non-null-assertion': 'warn',
193
- },
194
- },
195
-
196
- // Test files
197
- {
198
- files: ['**/*.test.{js,ts}', '**/*.spec.{js,ts}', '**/tests/**/*'],
199
- languageOptions: {
200
- globals: {
201
- ...globals.jest,
202
- describe: 'readonly',
203
- it: 'readonly',
204
- test: 'readonly',
205
- expect: 'readonly',
206
- beforeEach: 'readonly',
207
- afterEach: 'readonly',
208
- beforeAll: 'readonly',
209
- afterAll: 'readonly',
210
- vi: 'readonly',
211
- },
212
- },
213
- rules: {
214
- '@typescript-eslint/no-explicit-any': 'off',
215
- 'no-console': 'off',
216
- },
217
- },
218
-
219
- // Config files
220
- {
221
- files: ['**/*.config.{js,ts}', '**/.*rc.{js,ts}'],
222
- rules: {
223
- 'no-console': 'off',
224
- '@typescript-eslint/no-var-requires': 'off',
225
- },
226
- },
227
-
228
- // Ignore patterns
229
- {
230
- ignores: [
231
- 'build/**',
232
- 'coverage/**',
233
- 'dist/**',
234
- // The documentation site (VitePress) has its own tools and is not part of the package.
235
- 'docs/**',
236
- 'node_modules/**',
237
- 'public/**',
238
- 'storybook-static/**',
239
- '.nuxt/**',
240
- '.output/**',
241
- '**/*.min.js',
242
- ],
243
- },
244
-
245
- // Prettier — must be last to disable all formatting rules
246
- eslintConfigPrettier,
247
- ]
1
+ // The rules live in @stanislas-poisson/js-dev-tools; this path stays for the projects that use it.
2
+ export { default } from '@stanislas-poisson/js-dev-tools/eslint'
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * Knip configuration for @zairakai/js-dev-tools
3
3
  *
4
- * This package ships bundled configs for consumer projects.
5
- * Many dependencies are referenced as strings (prettier plugins, stylelint configs)
6
- * rather than ES imports — knip cannot trace those automatically.
4
+ * This package re-exports the configs of @stanislas-poisson/js-dev-tools, whose dependencies are referenced as strings
5
+ * by the tools; knip cannot trace those automatically, so the base package is the one that lists them.
7
6
  */
8
7
 
9
8
  export default {
@@ -16,19 +15,6 @@ export default {
16
15
  exclude: ['optionalPeerDependencies'],
17
16
 
18
17
  ignoreDependencies: [
19
- // Prettier plugins — referenced as strings in config/prettier.config.js
20
- '@prettier/plugin-php',
21
- 'prettier-plugin-blade',
22
- 'prettier-plugin-organize-imports',
23
-
24
- // Stylelint configs/plugins — referenced as strings in config/stylelint.config.js
25
- 'stylelint-config-html',
26
- 'stylelint-config-recommended-vue',
27
- 'stylelint-config-standard',
28
- 'stylelint-config-standard-scss',
29
- 'stylelint-order',
30
- 'stylelint-scss',
31
-
32
18
  // Coverage provider — referenced as string in config/vitest.config.js (provider: 'v8')
33
19
  '@vitest/coverage-v8',
34
20
 
@@ -1,121 +1,2 @@
1
- /**
2
- * Default Prettier configuration for @zairakai projects.
3
- */
4
-
5
- const config = {
6
- // Core formatting
7
- printWidth: 120,
8
- tabWidth: 2,
9
- useTabs: false,
10
- semi: false,
11
- singleQuote: true,
12
- quoteProps: 'as-needed',
13
- trailingComma: 'es5',
14
- bracketSpacing: true,
15
- bracketSameLine: false,
16
- arrowParens: 'always',
17
- endOfLine: 'lf',
18
-
19
- // HTML & Vue specific
20
- htmlWhitespaceSensitivity: 'css',
21
- vueIndentScriptAndStyle: true,
22
- singleAttributePerLine: false,
23
-
24
- // JSX specific
25
- jsxSingleQuote: true,
26
-
27
- // Prose formatting
28
- proseWrap: 'preserve',
29
- embeddedLanguageFormatting: 'auto',
30
-
31
- // Plugin configuration
32
- plugins: ['prettier-plugin-blade', '@prettier/plugin-php', 'prettier-plugin-organize-imports'],
33
-
34
- // File-specific overrides
35
- overrides: [
36
- // TypeScript/JavaScript files
37
- {
38
- files: ['*.ts', '*.tsx', '*.js', '*.jsx', '*.vue'],
39
- options: {
40
- semi: false,
41
- singleQuote: true,
42
- trailingComma: 'es5',
43
- },
44
- },
45
-
46
- // Vue files
47
- {
48
- files: '*.vue',
49
- options: {
50
- vueIndentScriptAndStyle: true,
51
- singleAttributePerLine: true,
52
- },
53
- },
54
-
55
- // SCSS/CSS files
56
- {
57
- files: ['*.scss', '*.css'],
58
- options: {
59
- tabWidth: 2,
60
- singleQuote: false,
61
- trailingComma: 'es5',
62
- semi: false,
63
- },
64
- },
65
-
66
- // PHP/Blade files
67
- {
68
- files: ['*.blade.php'],
69
- options: {
70
- tabWidth: 4,
71
- useTabs: false,
72
- phpVersion: '8.3',
73
- trailingCommaPHP: true,
74
- semi: false,
75
- },
76
- },
77
-
78
- // JSON files
79
- {
80
- files: ['*.json', '*.jsonc'],
81
- options: {
82
- tabWidth: 2,
83
- trailingComma: 'none',
84
- semi: false,
85
- },
86
- },
87
-
88
- // YAML files
89
- {
90
- files: ['*.yml', '*.yaml'],
91
- options: {
92
- tabWidth: 2,
93
- singleQuote: false,
94
- bracketSpacing: false,
95
- semi: false,
96
- },
97
- },
98
-
99
- // Package.json files
100
- {
101
- files: 'package.json',
102
- options: {
103
- tabWidth: 2,
104
- trailingComma: 'none',
105
- semi: false,
106
- },
107
- },
108
-
109
- // Configuration files
110
- {
111
- files: ['*.config.js', '*.config.ts', '.*rc.js', '.*rc.ts'],
112
- options: {
113
- tabWidth: 2,
114
- singleQuote: true,
115
- semi: false,
116
- },
117
- },
118
- ],
119
- }
120
-
121
- export default config
1
+ // The rules live in @stanislas-poisson/js-dev-tools; this path stays for the projects that use it.
2
+ export { default } from '@stanislas-poisson/js-dev-tools/prettier'
@@ -1,56 +1,2 @@
1
- /**
2
- * Full Stylelint config for @zairakai projects
3
- */
4
-
5
- export default {
6
- extends: [
7
- 'stylelint-config-standard-scss', // Base SCSS rules
8
- 'stylelint-config-recommended-vue', // Vue SFC support
9
- 'stylelint-config-html', // HTML support
10
- ],
11
- plugins: ['stylelint-scss'],
12
-
13
- overrides: [
14
- // Vue files
15
- {
16
- files: ['*.vue', '**/*.vue'],
17
- rules: {
18
- 'scss/at-rule-no-unknown': true,
19
- },
20
- },
21
- // SCSS files
22
- {
23
- files: ['*.scss', '**/*.scss'],
24
- rules: {
25
- 'scss/at-mixin-argumentless-call-parentheses': 'never',
26
- 'scss/dollar-variable-pattern': '^[_a-z0-9\\-]+$',
27
- 'scss/selector-no-redundant-nesting-selector': true,
28
- },
29
- },
30
- ],
31
-
32
- rules: {
33
- // SCSS basics
34
- 'declaration-block-no-redundant-longhand-properties': true,
35
- 'length-zero-no-unit': true,
36
-
37
- // SCSS operator & function rules
38
- 'scss/at-rule-no-unknown': true,
39
- 'scss/at-mixin-argumentless-call-parentheses': 'never',
40
-
41
- // Naming conventions
42
- 'scss/dollar-variable-pattern': '^[_a-z0-9\\-]+$',
43
- 'scss/selector-no-redundant-nesting-selector': true,
44
- },
45
-
46
- ignoreFiles: [
47
- 'node_modules/**/*',
48
- 'dist/**/*',
49
- 'build/**/*',
50
- 'coverage/**/*',
51
- 'public/**/*',
52
- '.nuxt/**/*',
53
- '.output/**/*',
54
- '**/*.min.css',
55
- ],
56
- }
1
+ // The rules live in @stanislas-poisson/js-dev-tools; this path stays for the projects that use it.
2
+ export { default } from '@stanislas-poisson/js-dev-tools/stylelint'
@@ -1,19 +1,3 @@
1
1
  {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "compilerOptions": {
4
- "target": "ES2022",
5
- "module": "ESNext",
6
- "moduleResolution": "bundler",
7
- "lib": ["ES2022"],
8
- "strict": true,
9
- "declaration": true,
10
- "declarationMap": true,
11
- "sourceMap": true,
12
- "skipLibCheck": true,
13
- "esModuleInterop": true,
14
- "forceConsistentCasingInFileNames": true,
15
- "noUnusedLocals": true,
16
- "noUnusedParameters": true,
17
- "exactOptionalPropertyTypes": true
18
- }
2
+ "extends": "@stanislas-poisson/js-dev-tools/config/tsconfig.base.json"
19
3
  }
@@ -1,25 +1,2 @@
1
- /**
2
- * Default Vitest configuration for @zairakai packages.
3
- * Provides sensible defaults for TypeScript projects.
4
- *
5
- * To customize, publish this file to your project:
6
- * bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish=vitest
7
- *
8
- * The published config (config/dev-tools/vitest.config.js) can extend this
9
- * base config and add project-specific settings (Vue plugin, jsdom, etc.).
10
- */
11
-
12
- import { defineConfig } from 'vitest/config'
13
-
14
- export default defineConfig({
15
- test: {
16
- globals: true,
17
- environment: 'node',
18
- coverage: {
19
- provider: 'v8',
20
- reporter: ['text', 'lcov', 'html', 'cobertura'],
21
- reportsDirectory: 'build/coverage',
22
- exclude: ['node_modules/**', 'dist/**', 'build/**', '**/*.config.*', '**/*.d.ts'],
23
- },
24
- },
25
- })
1
+ // The defaults live in @stanislas-poisson/js-dev-tools; this path stays for the projects that use it.
2
+ export { default } from '@stanislas-poisson/js-dev-tools/vitest'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zairakai/js-dev-tools",
3
- "version": "3.4.4",
3
+ "version": "3.5.0",
4
4
  "description": "The unified and centralized development toolkit for JavaScript/TypeScript projects - ESLint, Prettier, Stylelint, Knip, Vitest, Git Hooks, and GitLab CI pipeline templates",
5
5
  "keywords": [
6
6
  "dev-tools",
@@ -88,27 +88,11 @@
88
88
  "validate": "make quality"
89
89
  },
90
90
  "dependencies": {
91
- "@eslint/compat": "^2.1.1",
92
- "@eslint/js": "^10.0.1",
93
- "@prettier/plugin-php": "^0.25.0",
94
- "@typescript-eslint/eslint-plugin": "^8.71.1",
95
- "@typescript-eslint/parser": "^8.71.1",
91
+ "@stanislas-poisson/js-dev-tools": "^1.0.0",
96
92
  "eslint": "^10.12.0",
97
- "eslint-config-prettier": "^10.1.8",
98
- "eslint-plugin-vue": "^10.11.1",
99
- "globals": "^17.13.0",
100
93
  "markdownlint-cli2": "^0.23.3",
101
94
  "prettier": "^3.9.9",
102
- "prettier-plugin-blade": "^3.3.3",
103
- "prettier-plugin-organize-imports": "^4.3.0",
104
- "stylelint": "^17.16.0",
105
- "stylelint-config-html": "^2.0.0",
106
- "stylelint-config-recommended-vue": "^2.0.0",
107
- "stylelint-config-standard": "^40.0.0",
108
- "stylelint-config-standard-scss": "^17.0.0",
109
- "stylelint-order": "^8.1.1",
110
- "stylelint-scss": "^7.3.0",
111
- "vue-eslint-parser": "^10.4.1"
95
+ "stylelint": "^17.16.0"
112
96
  },
113
97
  "devDependencies": {
114
98
  "@vitest/coverage-v8": "^5.0.3",