@zairakai/js-dev-tools 1.0.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.
Files changed (69) hide show
  1. package/.editorconfig +86 -0
  2. package/.gitlab/ci/pipeline-js-app.yml +75 -0
  3. package/.gitlab/ci/pipeline-js-package.yml +360 -0
  4. package/LICENSE +21 -0
  5. package/README.md +206 -0
  6. package/config/.markdownlint.json +7 -0
  7. package/config/.markdownlintignore +5 -0
  8. package/config/.prettierignore +11 -0
  9. package/config/.stylelintignore +7 -0
  10. package/config/eslint.config.js +198 -0
  11. package/config/knip.config.js +40 -0
  12. package/config/prettier.config.js +121 -0
  13. package/config/stylelint.config.js +56 -0
  14. package/config/tsconfig.base.json +20 -0
  15. package/config/vitest.config.js +25 -0
  16. package/index.js +24 -0
  17. package/package.json +148 -0
  18. package/scripts/build.sh +58 -0
  19. package/scripts/ci-quality.sh +51 -0
  20. package/scripts/config.sh +254 -0
  21. package/scripts/doctor.sh +74 -0
  22. package/scripts/eslint-fix.sh +38 -0
  23. package/scripts/eslint.sh +49 -0
  24. package/scripts/install-bats.sh +227 -0
  25. package/scripts/install-hooks.sh +167 -0
  26. package/scripts/install-markdownlint.sh +31 -0
  27. package/scripts/install-shellcheck.sh +232 -0
  28. package/scripts/knip.sh +40 -0
  29. package/scripts/markdownlint-fix.sh +8 -0
  30. package/scripts/markdownlint.sh +84 -0
  31. package/scripts/outdated.sh +70 -0
  32. package/scripts/prettier-fix.sh +52 -0
  33. package/scripts/prettier.sh +53 -0
  34. package/scripts/setup-project.sh +816 -0
  35. package/scripts/stylelint-fix.sh +64 -0
  36. package/scripts/stylelint.sh +66 -0
  37. package/scripts/test.sh +40 -0
  38. package/scripts/typecheck.sh +41 -0
  39. package/scripts/validate-shellcheck.sh +70 -0
  40. package/stubs/githooks/commit-msg +34 -0
  41. package/stubs/githooks/pre-commit +58 -0
  42. package/stubs/githooks/pre-push +57 -0
  43. package/stubs/githooks/prepare-commit-msg +39 -0
  44. package/stubs/gitlab-ci/gitlab-ci.yml.stub +18 -0
  45. package/stubs/gitlab-ci/gitlab-pipeline-js-app.yml.stub +16 -0
  46. package/stubs/governance/CODE_OF_CONDUCT.md.stub +8 -0
  47. package/stubs/governance/CONTRIBUTING.md.stub +39 -0
  48. package/stubs/governance/SECURITY.md.stub +41 -0
  49. package/stubs/quality/eslint.config.js.stub +18 -0
  50. package/stubs/quality/knip.config.js.stub +14 -0
  51. package/stubs/style/prettier.config.js.stub +16 -0
  52. package/stubs/style/stylelint.config.js.stub +17 -0
  53. package/stubs/testing/vitest.config.js.stub +18 -0
  54. package/stubs/typescript/tsconfig.json.stub +10 -0
  55. package/tools/make/bats.mk +49 -0
  56. package/tools/make/code-style.mk +20 -0
  57. package/tools/make/core.mk +56 -0
  58. package/tools/make/help.mk +32 -0
  59. package/tools/make/knip.mk +7 -0
  60. package/tools/make/markdownlint.mk +17 -0
  61. package/tools/make/quality.mk +19 -0
  62. package/tools/make/shellcheck.mk +14 -0
  63. package/tools/make/stylelint.mk +11 -0
  64. package/tools/make/test.mk +19 -0
  65. package/tools/make/typescript.mk +10 -0
  66. package/tools/make/utils.mk +44 -0
  67. package/tools/make/variables.mk +42 -0
  68. package/tools/scripts/git-cleanup.sh +53 -0
  69. package/tools/scripts/git-update.sh +37 -0
package/README.md ADDED
@@ -0,0 +1,206 @@
1
+ # @zairakai/js-dev-tools
2
+
3
+ [![Main][pipeline-main-badge]][pipeline-main-link]
4
+ [![Develop][pipeline-develop-badge]][pipeline-develop-link]
5
+
6
+ [![npm][npm-badge]][npm-link]
7
+ [![GitLab Release][gitlab-release-badge]][gitlab-release]
8
+ [![License][license-badge]][license]
9
+
10
+ [![Node.js][node-badge]][node]
11
+ [![ESLint][eslint-badge]][eslint]
12
+ [![Prettier][prettier-badge]][prettier]
13
+ [![Stylelint][stylelint-badge]][stylelint]
14
+
15
+ One unified toolkit to set up JavaScript/TypeScript quality tooling. Context-aware by default — it adapts to both standalone packages and full-stack applications.
16
+
17
+ ---
18
+
19
+ ## Why @zairakai/js-dev-tools?
20
+
21
+ | Concept | Benefit |
22
+ | :--- | :--- |
23
+ | **Unified Logic** | The same quality gate for all your projects. Only the target (package or app) changes, not the rigor. |
24
+ | **Concentrated Configs** | Centralized, opinionated configurations for all your tools. Avoid configuration drift across projects. |
25
+ | **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. |
26
+ | **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. |
27
+ | **Zero Friction** | Automated setup script handles the heavy lifting on install. |
28
+
29
+ ---
30
+
31
+ ## Features
32
+
33
+ | Tool | Responsibility |
34
+ | :--- | :--- |
35
+ | **ESLint** | Flat config with TypeScript, Vue 3, and import rules. |
36
+ | **Prettier** | Opinionated formatter with SCSS and Tailwind support. |
37
+ | **Stylelint** | SCSS linting with modern property ordering. |
38
+ | **Markdownlint** | Consistent Markdown across all documentation. |
39
+ | **Vitest** | Unit testing with v8 coverage. |
40
+ | **Knip** | Dead code and unused dependency detection. |
41
+ | **TypeScript** | Shared `tsconfig.base.json` for strict mode builds. |
42
+ | **GitLab CI** | Reusable pipeline templates for npm packages and Laravel full-stack. |
43
+ | **Git Hooks** | Automated quality checks and ticket prefixing. |
44
+ | **Makefile** | Unified `make quality`, `make test`, `make ci` targets (delegated to core). |
45
+ | **Shell Scripts** | Automated setup and config publishing. |
46
+
47
+ On install, the `postinstall` script:
48
+
49
+ - creates `Makefile` if missing (delegating to `node_modules/@zairakai/js-dev-tools/tools/make/core.mk`)
50
+ - creates `.editorconfig`
51
+ - creates `config/dev-tools/eslint.config.js` baseline
52
+ - reports optional packages not yet installed
53
+
54
+ ---
55
+
56
+ ## Install
57
+
58
+ ```bash
59
+ npm install --save-dev @zairakai/js-dev-tools
60
+ ```
61
+
62
+ For Laravel full-stack projects, pair with `zairakai/laravel-dev-tools`:
63
+
64
+ ```bash
65
+ composer require --dev zairakai/laravel-dev-tools
66
+ npm install --save-dev @zairakai/js-dev-tools
67
+ php artisan dev-tools:publish --fullstack
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Usage
73
+
74
+ ```bash
75
+ make quality # eslint + prettier + stylelint + knip + markdownlint + shellcheck
76
+ make quality-fix # auto-fix all fixable issues
77
+ make test # vitest
78
+ make test-all # vitest + bats
79
+ make test-coverage # vitest with coverage report
80
+ make typecheck # tsc --noEmit
81
+ make build # tsup or tsc
82
+ make ci # full pipeline simulation
83
+ make doctor # environment diagnostics
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Configuration
89
+
90
+ Extend the shared configs in your project files:
91
+
92
+ ```js
93
+ // eslint.config.js
94
+ export { default } from '@zairakai/js-dev-tools/eslint'
95
+
96
+ // prettier.config.js
97
+ export { default } from '@zairakai/js-dev-tools/prettier'
98
+
99
+ // stylelint.config.js
100
+ export { default } from '@zairakai/js-dev-tools/stylelint'
101
+
102
+ // vitest.config.js
103
+ import baseConfig from '@zairakai/js-dev-tools/vitest'
104
+ import { defineConfig } from 'vitest/config'
105
+ export default defineConfig({ ...baseConfig, test: { ...baseConfig.test } })
106
+ ```
107
+
108
+ ```json
109
+ // tsconfig.json
110
+ { "extends": "@zairakai/js-dev-tools/tsconfig" }
111
+ ```
112
+
113
+ ---
114
+
115
+ ## Publishing configs
116
+
117
+ Publish individual config files to `config/dev-tools/` (never overwritten unless `--force`):
118
+
119
+ ```bash
120
+ # All at once
121
+ bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish
122
+
123
+ # By group
124
+ bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish=quality
125
+ bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish=style
126
+ bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish=testing
127
+ bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish=hooks
128
+ bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish=gitlab-ci
129
+ bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish=typescript
130
+
131
+ # Single files
132
+ bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish=eslint
133
+ bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish=prettier
134
+ bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish=stylelint
135
+ bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish=vitest
136
+ bash node_modules/@zairakai/js-dev-tools/scripts/setup-project.sh --publish=tsconfig
137
+ ```
138
+
139
+ ---
140
+
141
+ ## GitLab CI pipeline templates
142
+
143
+ Include in your consumer project's `.gitlab-ci.yml`:
144
+
145
+ ```yaml
146
+ # npm package pipeline
147
+ include:
148
+ - project: 'zairakai/npm-packages/js-dev-tools'
149
+ ref: v1.0.0 # pin to a release tag for reproducible builds
150
+ file: '.gitlab/ci/pipeline-js-package.yml'
151
+
152
+ variables:
153
+ CACHE_KEY: "my-package-v1"
154
+ NPM_PACKAGE_NAME: "@myorg/my-package"
155
+ ```
156
+
157
+ Available templates:
158
+
159
+ - `.gitlab/ci/pipeline-js-package.yml` — security → install → validate → quality → test → build → publish → release
160
+ - `.gitlab/ci/pipeline-js-app.yml` — JS quality + test jobs for Laravel full-stack apps
161
+
162
+ ---
163
+
164
+ ## Development
165
+
166
+ ```bash
167
+ make quality # full quality check
168
+ make test-all # vitest + bats
169
+ make bats # shell script tests only
170
+ make doctor # environment diagnostics
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Getting Help
176
+
177
+ [![License][license-badge]][license]
178
+ [![Security Policy][security-badge]][security]
179
+ [![Issues][issues-badge]][issues]
180
+
181
+ **Made with ❤️ by [Zairakai][ecosystem]**
182
+
183
+ <!-- Reference Links -->
184
+ [pipeline-main-badge]: https://gitlab.com/zairakai/npm-packages/js-dev-tools/badges/main/pipeline.svg?ignore_skipped=true&key_text=Main
185
+ [pipeline-main-link]: https://gitlab.com/zairakai/npm-packages/js-dev-tools/-/commits/main
186
+ [pipeline-develop-badge]: https://gitlab.com/zairakai/npm-packages/js-dev-tools/badges/develop/pipeline.svg?ignore_skipped=true&key_text=Develop
187
+ [pipeline-develop-link]: https://gitlab.com/zairakai/npm-packages/js-dev-tools/-/commits/develop
188
+ [npm-badge]: https://img.shields.io/npm/v/@zairakai/js-dev-tools
189
+ [npm-link]: https://www.npmjs.com/package/@zairakai/js-dev-tools
190
+ [gitlab-release-badge]: https://img.shields.io/gitlab/v/release/zairakai/npm-packages/js-dev-tools?logo=gitlab
191
+ [gitlab-release]: https://gitlab.com/zairakai/npm-packages/js-dev-tools/-/releases
192
+ [license-badge]: https://img.shields.io/badge/license-MIT-blue.svg
193
+ [license]: ./LICENSE
194
+ [security-badge]: https://img.shields.io/badge/security-scanned-green.svg
195
+ [security]: ./SECURITY.md
196
+ [issues-badge]: https://img.shields.io/gitlab/issues/open-raw/zairakai%2Fnpm-packages%2Fdev-tools?logo=gitlab&label=Issues
197
+ [issues]: https://gitlab.com/zairakai/npm-packages/js-dev-tools/-/issues
198
+ [node-badge]: https://img.shields.io/badge/node.js-%3E%3D22-green.svg?logo=node.js
199
+ [node]: https://nodejs.org
200
+ [eslint-badge]: https://img.shields.io/badge/code%20style-eslint-4B32C3.svg?logo=eslint
201
+ [eslint]: https://eslint.org
202
+ [prettier-badge]: https://img.shields.io/badge/formatter-prettier-F7B93E.svg?logo=prettier
203
+ [prettier]: https://prettier.io
204
+ [stylelint-badge]: https://img.shields.io/badge/css-stylelint-263238.svg?logo=stylelint
205
+ [stylelint]: https://stylelint.io
206
+ [ecosystem]: https://gitlab.com/zairakai
@@ -0,0 +1,7 @@
1
+ {
2
+ "default": true,
3
+ "MD013": false,
4
+ "MD024": {
5
+ "siblings_only": true
6
+ }
7
+ }
@@ -0,0 +1,5 @@
1
+ .cache/
2
+ .git/
3
+ .opencode/
4
+ node_modules/
5
+ *.min.md
@@ -0,0 +1,11 @@
1
+ build/
2
+ coverage/
3
+ dist/
4
+ node_modules/
5
+ public/
6
+ vendor/
7
+ *.lock
8
+ *.md
9
+ *.min.css
10
+ *.min.js
11
+ gl-*.json
@@ -0,0 +1,7 @@
1
+ node_modules/
2
+ dist/
3
+ build/
4
+ coverage/
5
+ vendor/
6
+ public/
7
+ *.min.css
@@ -0,0 +1,198 @@
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
+ // Base JavaScript rules
20
+ pluginJs.configs.recommended,
21
+
22
+ // Vue configurations
23
+ ...pluginVue.configs['flat/strongly-recommended'],
24
+
25
+ // Prettier integration (must be last)
26
+ eslintConfigPrettier,
27
+
28
+ // Base configuration for all files
29
+ {
30
+ languageOptions: {
31
+ globals: {
32
+ ...globals.browser,
33
+ ...globals.node,
34
+ ...globals.es2022,
35
+ },
36
+ parserOptions: {
37
+ ecmaVersion: 'latest',
38
+ sourceType: 'module',
39
+ },
40
+ },
41
+ rules: {
42
+ // Yoda style enforcement (Zairakai convention)
43
+ yoda: [
44
+ 'error',
45
+ 'always',
46
+ {
47
+ exceptRange: true,
48
+ onlyEquality: false,
49
+ },
50
+ ],
51
+
52
+ // Code quality
53
+ 'no-unused-vars': [
54
+ 'error',
55
+ {
56
+ argsIgnorePattern: '^_',
57
+ varsIgnorePattern: '^_',
58
+ caughtErrorsIgnorePattern: '^_',
59
+ },
60
+ ],
61
+ 'no-unused-expressions': [
62
+ 'error',
63
+ {
64
+ allowShortCircuit: true,
65
+ allowTernary: true,
66
+ allowTaggedTemplates: true,
67
+ },
68
+ ],
69
+ 'no-console': [
70
+ 'warn',
71
+ {
72
+ allow: ['warn', 'error', 'info', 'debug'],
73
+ },
74
+ ],
75
+ 'no-debugger': 'error',
76
+
77
+ // Best practices
78
+ eqeqeq: [
79
+ 'error',
80
+ 'always',
81
+ {
82
+ null: 'ignore',
83
+ },
84
+ ],
85
+ curly: ['error', 'all'],
86
+ 'prefer-const': 'error',
87
+ 'no-var': 'error',
88
+ 'object-shorthand': 'error',
89
+ 'prefer-template': 'error',
90
+ 'prefer-arrow-callback': 'error',
91
+
92
+ // Import rules
93
+ 'sort-imports': [
94
+ 'error',
95
+ {
96
+ ignoreDeclarationSort: true,
97
+ ignoreMemberSort: false,
98
+ memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
99
+ },
100
+ ],
101
+
102
+ // Vue specific rules (relaxed for flexibility)
103
+ 'vue/multi-word-component-names': 'off',
104
+ 'vue/require-default-prop': 'off',
105
+ 'vue/valid-template-root': 'off',
106
+ 'vue/no-v-html': 'warn',
107
+ 'vue/require-v-for-key': 'error',
108
+ 'vue/no-unused-components': 'warn',
109
+ 'vue/component-name-in-template-casing': ['error', 'PascalCase'],
110
+ 'vue/attribute-hyphenation': ['error', 'always'],
111
+ 'vue/v-on-event-hyphenation': ['error', 'always'],
112
+ },
113
+ },
114
+
115
+ // TypeScript specific configuration
116
+ {
117
+ files: ['**/*.ts', '**/*.tsx', '**/*.vue'],
118
+ languageOptions: {
119
+ parser: parserTypeScript,
120
+ parserOptions: {
121
+ project: './tsconfig.json',
122
+ extraFileExtensions: ['.vue'],
123
+ },
124
+ },
125
+ plugins: {
126
+ '@typescript-eslint': pluginTypeScript,
127
+ },
128
+ rules: {
129
+ // Disable JS rules that conflict with TS
130
+ 'no-unused-vars': 'off',
131
+ 'no-undef': 'off',
132
+
133
+ // Enable TS rules
134
+ '@typescript-eslint/no-unused-vars': [
135
+ 'error',
136
+ {
137
+ argsIgnorePattern: '^_',
138
+ varsIgnorePattern: '^_',
139
+ caughtErrorsIgnorePattern: '^_',
140
+ },
141
+ ],
142
+ '@typescript-eslint/no-explicit-any': 'warn',
143
+ '@typescript-eslint/explicit-function-return-type': 'off',
144
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
145
+ '@typescript-eslint/prefer-nullish-coalescing': 'error',
146
+ '@typescript-eslint/prefer-optional-chain': 'error',
147
+ '@typescript-eslint/no-non-null-assertion': 'warn',
148
+ },
149
+ },
150
+
151
+ // Test files configuration
152
+ {
153
+ files: ['**/*.test.{js,ts}', '**/*.spec.{js,ts}', '**/tests/**/*'],
154
+ languageOptions: {
155
+ globals: {
156
+ ...globals.jest,
157
+ ...globals.vitest,
158
+ describe: 'readonly',
159
+ it: 'readonly',
160
+ test: 'readonly',
161
+ expect: 'readonly',
162
+ beforeEach: 'readonly',
163
+ afterEach: 'readonly',
164
+ beforeAll: 'readonly',
165
+ afterAll: 'readonly',
166
+ vi: 'readonly',
167
+ },
168
+ },
169
+ rules: {
170
+ '@typescript-eslint/no-explicit-any': 'off',
171
+ 'no-console': 'off',
172
+ },
173
+ },
174
+
175
+ // Configuration files
176
+ {
177
+ files: ['**/*.config.{js,ts}', '**/.*rc.{js,ts}'],
178
+ rules: {
179
+ 'no-console': 'off',
180
+ '@typescript-eslint/no-var-requires': 'off',
181
+ },
182
+ },
183
+
184
+ // Ignore patterns
185
+ {
186
+ ignores: [
187
+ 'build/**',
188
+ 'coverage/**',
189
+ 'dist/**',
190
+ 'node_modules/**',
191
+ 'public/**',
192
+ 'storybook-static/**',
193
+ '.nuxt/**',
194
+ '.output/**',
195
+ '**/*.min.js',
196
+ ],
197
+ },
198
+ ]
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Knip configuration for @zairakai/js-dev-tools
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.
7
+ */
8
+
9
+ export default {
10
+ entry: ['config/**/*.js'],
11
+
12
+ // "Referenced optional peerDependencies" is informational — stylelint is intentionally optional
13
+ exclude: ['optionalPeerDependencies'],
14
+
15
+ ignoreDependencies: [
16
+ // Prettier plugins — referenced as strings in config/prettier.config.js
17
+ '@prettier/plugin-php',
18
+ 'prettier-plugin-blade',
19
+ 'prettier-plugin-organize-imports',
20
+
21
+ // Stylelint configs/plugins — referenced as strings in config/stylelint.config.js
22
+ 'stylelint-config-html',
23
+ 'stylelint-config-recommended-vue',
24
+ 'stylelint-config-standard',
25
+ 'stylelint-config-standard-scss',
26
+ 'stylelint-order',
27
+ 'stylelint-scss',
28
+
29
+ // Coverage provider — referenced as string in config/vitest.config.js (provider: 'v8')
30
+ '@vitest/coverage-v8',
31
+
32
+ // Optional peer dep bundled for consumers
33
+ 'zod',
34
+
35
+ // Used in Makefiles/Scripts for normalization
36
+ 'sort-package-json',
37
+ ],
38
+
39
+ ignoreBinaries: ['make'],
40
+ }
@@ -0,0 +1,121 @@
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
@@ -0,0 +1,56 @@
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
+ }
@@ -0,0 +1,20 @@
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
+ "ignoreDeprecations": "5.0"
19
+ }
20
+ }