@zairakai/dev-tools 1.0.11
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/.editorconfig +86 -0
- package/.gitlab/ci/pipeline-js.yml +189 -0
- package/.gitlab/ci/pipeline-npm-package.yml +353 -0
- package/LICENSE +21 -0
- package/README.md +162 -0
- package/config/.markdownlint.json +7 -0
- package/config/.markdownlintignore +5 -0
- package/config/.prettierignore +10 -0
- package/config/.stylelintignore +7 -0
- package/config/eslint.config.js +191 -0
- package/config/prettier.config.js +121 -0
- package/config/stylelint.config.js +56 -0
- package/config/tsconfig.base.json +20 -0
- package/config/vitest.config.js +25 -0
- package/index.js +22 -0
- package/package.json +137 -0
- package/scripts/build.sh +54 -0
- package/scripts/ci-quality.sh +47 -0
- package/scripts/config.sh +193 -0
- package/scripts/eslint-fix.sh +34 -0
- package/scripts/eslint.sh +46 -0
- package/scripts/install-bats.sh +227 -0
- package/scripts/install-shellcheck.sh +232 -0
- package/scripts/knip.sh +33 -0
- package/scripts/markdownlint-fix.sh +8 -0
- package/scripts/markdownlint.sh +43 -0
- package/scripts/prettier-fix.sh +33 -0
- package/scripts/prettier.sh +34 -0
- package/scripts/setup-project.sh +702 -0
- package/scripts/stylelint-fix.sh +39 -0
- package/scripts/stylelint.sh +47 -0
- package/scripts/test.sh +43 -0
- package/scripts/typecheck.sh +35 -0
- package/scripts/validate-shellcheck.sh +70 -0
- package/stubs/eslint.config.js.stub +18 -0
- package/stubs/gitlab-ci.yml.stub +18 -0
- package/stubs/gitlab-pipeline-js.yml.stub +16 -0
- package/stubs/prettier.config.js.stub +16 -0
- package/stubs/stylelint.config.js.stub +17 -0
- package/stubs/tsconfig.json.stub +10 -0
- package/stubs/vitest.config.js.stub +18 -0
- package/tools/make/bats.mk +49 -0
- package/tools/make/code-style.mk +29 -0
- package/tools/make/core.mk +50 -0
- package/tools/make/help.mk +32 -0
- package/tools/make/markdownlint.mk +17 -0
- package/tools/make/quality.mk +20 -0
- package/tools/make/shellcheck.mk +14 -0
- package/tools/make/stylelint.mk +0 -0
- package/tools/make/test.mk +19 -0
- package/tools/make/typescript.mk +14 -0
- package/tools/make/variables.mk +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# @zairakai/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 package for JavaScript/TypeScript quality tools. Zero-config by default, publish only what you want.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yarn add --dev @zairakai/dev-tools
|
|
23
|
+
# or
|
|
24
|
+
npm install --save-dev @zairakai/dev-tools
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
On install it will:
|
|
28
|
+
|
|
29
|
+
- create `Makefile` if missing
|
|
30
|
+
- create `.editorconfig`
|
|
31
|
+
- create `config/dev-tools/eslint.config.js` baseline
|
|
32
|
+
- suggest optional tools
|
|
33
|
+
|
|
34
|
+
Laravel apps detected + `zairakai/laravel-dev-tools` installed:
|
|
35
|
+
|
|
36
|
+
- the setup delegates to the Laravel full-stack setup to keep a single workflow
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Quick Start (Laravel + Vue)
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
composer require --dev zairakai/laravel-dev-tools
|
|
44
|
+
npm install --save-dev @zairakai/dev-tools
|
|
45
|
+
php artisan dev-tools:publish --fullstack
|
|
46
|
+
php artisan dev-tools:publish --publish=gitlab-ci
|
|
47
|
+
make quality
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Use
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
make quality
|
|
56
|
+
make test
|
|
57
|
+
make ci
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Tests
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
make test
|
|
66
|
+
make bats
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Publish configs (optional)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# all
|
|
75
|
+
bash node_modules/@zairakai/dev-tools/scripts/setup-project.sh --publish
|
|
76
|
+
|
|
77
|
+
# groups
|
|
78
|
+
bash node_modules/@zairakai/dev-tools/scripts/setup-project.sh --publish=quality
|
|
79
|
+
bash node_modules/@zairakai/dev-tools/scripts/setup-project.sh --publish=style
|
|
80
|
+
bash node_modules/@zairakai/dev-tools/scripts/setup-project.sh --publish=testing
|
|
81
|
+
bash node_modules/@zairakai/dev-tools/scripts/setup-project.sh --publish=typescript
|
|
82
|
+
bash node_modules/@zairakai/dev-tools/scripts/setup-project.sh --publish=gitlab-ci
|
|
83
|
+
|
|
84
|
+
# single files
|
|
85
|
+
bash node_modules/@zairakai/dev-tools/scripts/setup-project.sh --publish=eslint
|
|
86
|
+
bash node_modules/@zairakai/dev-tools/scripts/setup-project.sh --publish=prettier
|
|
87
|
+
bash node_modules/@zairakai/dev-tools/scripts/setup-project.sh --publish=markdownlint
|
|
88
|
+
bash node_modules/@zairakai/dev-tools/scripts/setup-project.sh --publish=vitest
|
|
89
|
+
bash node_modules/@zairakai/dev-tools/scripts/setup-project.sh --publish=tsconfig
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Published files go to `config/dev-tools/` and are never overwritten unless you use `--force`.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## GitLab CI
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
bash node_modules/@zairakai/dev-tools/scripts/setup-project.sh --publish=gitlab-ci
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Laravel apps: use the full-stack CI from `zairakai/laravel-dev-tools` for one unified pipeline.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Key make targets
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
make quality # eslint + prettier + stylelint + markdownlint + shellcheck
|
|
110
|
+
make quality-fix # auto-fix
|
|
111
|
+
make test # vitest
|
|
112
|
+
make typecheck # tsc --noEmit
|
|
113
|
+
make build # tsup or tsc
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Getting Help
|
|
119
|
+
|
|
120
|
+
[![License][license-badge]][license]
|
|
121
|
+
[![Security Policy][security-badge]][security]
|
|
122
|
+
[![Issues][issues-badge]][issues]
|
|
123
|
+
[![Discord][discord-badge]][discord]
|
|
124
|
+
|
|
125
|
+
Built with love by the Zairakai team for JavaScript/TypeScript developers
|
|
126
|
+
|
|
127
|
+
<!-- Reference Links -->
|
|
128
|
+
[pipeline-main-badge]: https://gitlab.com/zairakai/npm/dev-tools/badges/main/pipeline.svg?ignore_skipped=true&key_text=Main
|
|
129
|
+
[pipeline-main-link]: https://gitlab.com/zairakai/npm/dev-tools/-/commits/main
|
|
130
|
+
|
|
131
|
+
[pipeline-develop-badge]: https://gitlab.com/zairakai/npm/dev-tools/badges/develop/pipeline.svg?ignore_skipped=true&key_text=Develop
|
|
132
|
+
[pipeline-develop-link]: https://gitlab.com/zairakai/npm/dev-tools/-/commits/develop
|
|
133
|
+
|
|
134
|
+
[npm-badge]: https://img.shields.io/npm/v/@zairakai/dev-tools
|
|
135
|
+
[npm-link]: https://www.npmjs.com/package/@zairakai/dev-tools
|
|
136
|
+
|
|
137
|
+
[gitlab-release-badge]: https://img.shields.io/gitlab/v/release/zairakai/npm/dev-tools?logo=gitlab
|
|
138
|
+
[gitlab-release]: https://gitlab.com/zairakai/npm/dev-tools/-/releases
|
|
139
|
+
|
|
140
|
+
[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg
|
|
141
|
+
[license]: ./LICENSE
|
|
142
|
+
|
|
143
|
+
[security-badge]: https://img.shields.io/badge/security-scanned-green.svg
|
|
144
|
+
[security]: ./SECURITY.md
|
|
145
|
+
|
|
146
|
+
[issues-badge]: https://img.shields.io/gitlab/issues/open-raw/zairakai%2Fnpm%2Fdev-tools?logo=gitlab&label=Issues
|
|
147
|
+
[issues]: https://gitlab.com/zairakai/npm/dev-tools/-/issues
|
|
148
|
+
|
|
149
|
+
[discord-badge]: https://img.shields.io/discord/1260000352699289621?logo=discord&label=Discord&color=5865F2
|
|
150
|
+
[discord]: https://discord.gg/MAmD5SG8Zu
|
|
151
|
+
|
|
152
|
+
[node-badge]: https://img.shields.io/badge/node.js-%3E%3D22-green.svg?logo=node.js
|
|
153
|
+
[node]: https://nodejs.org
|
|
154
|
+
|
|
155
|
+
[eslint-badge]: https://img.shields.io/badge/code%20style-eslint-4B32C3.svg?logo=eslint
|
|
156
|
+
[eslint]: https://eslint.org
|
|
157
|
+
|
|
158
|
+
[prettier-badge]: https://img.shields.io/badge/formatter-prettier-F7B93E.svg?logo=prettier
|
|
159
|
+
[prettier]: https://prettier.io
|
|
160
|
+
|
|
161
|
+
[stylelint-badge]: https://img.shields.io/badge/css-stylelint-263238.svg?logo=stylelint
|
|
162
|
+
[stylelint]: https://stylelint.io
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default ESLint configuration for @zairakai projects.
|
|
3
|
+
*/
|
|
4
|
+
import pluginJs from '@eslint/js'
|
|
5
|
+
import pluginTypeScript from '@typescript-eslint/eslint-plugin'
|
|
6
|
+
import parserTypeScript from '@typescript-eslint/parser'
|
|
7
|
+
import eslintConfigPrettier from 'eslint-config-prettier'
|
|
8
|
+
import pluginVue from 'eslint-plugin-vue'
|
|
9
|
+
import globals from 'globals'
|
|
10
|
+
|
|
11
|
+
export default [
|
|
12
|
+
// Base JavaScript rules
|
|
13
|
+
pluginJs.configs.recommended,
|
|
14
|
+
|
|
15
|
+
// Vue configurations
|
|
16
|
+
...pluginVue.configs['flat/strongly-recommended'],
|
|
17
|
+
|
|
18
|
+
// Prettier integration (must be last)
|
|
19
|
+
eslintConfigPrettier,
|
|
20
|
+
|
|
21
|
+
// Base configuration for all files
|
|
22
|
+
{
|
|
23
|
+
languageOptions: {
|
|
24
|
+
globals: {
|
|
25
|
+
...globals.browser,
|
|
26
|
+
...globals.node,
|
|
27
|
+
...globals.es2022,
|
|
28
|
+
},
|
|
29
|
+
parserOptions: {
|
|
30
|
+
ecmaVersion: 'latest',
|
|
31
|
+
sourceType: 'module',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
rules: {
|
|
35
|
+
// Yoda style enforcement (Zairakai convention)
|
|
36
|
+
yoda: [
|
|
37
|
+
'error',
|
|
38
|
+
'always',
|
|
39
|
+
{
|
|
40
|
+
exceptRange: true,
|
|
41
|
+
onlyEquality: false,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
|
|
45
|
+
// Code quality
|
|
46
|
+
'no-unused-vars': [
|
|
47
|
+
'error',
|
|
48
|
+
{
|
|
49
|
+
argsIgnorePattern: '^_',
|
|
50
|
+
varsIgnorePattern: '^_',
|
|
51
|
+
caughtErrorsIgnorePattern: '^_',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
'no-unused-expressions': [
|
|
55
|
+
'error',
|
|
56
|
+
{
|
|
57
|
+
allowShortCircuit: true,
|
|
58
|
+
allowTernary: true,
|
|
59
|
+
allowTaggedTemplates: true,
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
'no-console': [
|
|
63
|
+
'warn',
|
|
64
|
+
{
|
|
65
|
+
allow: ['warn', 'error', 'info', 'debug'],
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
'no-debugger': 'error',
|
|
69
|
+
|
|
70
|
+
// Best practices
|
|
71
|
+
eqeqeq: [
|
|
72
|
+
'error',
|
|
73
|
+
'always',
|
|
74
|
+
{
|
|
75
|
+
null: 'ignore',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
curly: ['error', 'all'],
|
|
79
|
+
'prefer-const': 'error',
|
|
80
|
+
'no-var': 'error',
|
|
81
|
+
'object-shorthand': 'error',
|
|
82
|
+
'prefer-template': 'error',
|
|
83
|
+
'prefer-arrow-callback': 'error',
|
|
84
|
+
|
|
85
|
+
// Import rules
|
|
86
|
+
'sort-imports': [
|
|
87
|
+
'error',
|
|
88
|
+
{
|
|
89
|
+
ignoreDeclarationSort: true,
|
|
90
|
+
ignoreMemberSort: false,
|
|
91
|
+
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
|
|
95
|
+
// Vue specific rules (relaxed for flexibility)
|
|
96
|
+
'vue/multi-word-component-names': 'off',
|
|
97
|
+
'vue/require-default-prop': 'off',
|
|
98
|
+
'vue/valid-template-root': 'off',
|
|
99
|
+
'vue/no-v-html': 'warn',
|
|
100
|
+
'vue/require-v-for-key': 'error',
|
|
101
|
+
'vue/no-unused-components': 'warn',
|
|
102
|
+
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
|
|
103
|
+
'vue/attribute-hyphenation': ['error', 'always'],
|
|
104
|
+
'vue/v-on-event-hyphenation': ['error', 'always'],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
// TypeScript specific configuration
|
|
109
|
+
{
|
|
110
|
+
files: ['**/*.ts', '**/*.tsx', '**/*.vue'],
|
|
111
|
+
languageOptions: {
|
|
112
|
+
parser: parserTypeScript,
|
|
113
|
+
parserOptions: {
|
|
114
|
+
project: './tsconfig.json',
|
|
115
|
+
extraFileExtensions: ['.vue'],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
plugins: {
|
|
119
|
+
'@typescript-eslint': pluginTypeScript,
|
|
120
|
+
},
|
|
121
|
+
rules: {
|
|
122
|
+
// Disable JS rules that conflict with TS
|
|
123
|
+
'no-unused-vars': 'off',
|
|
124
|
+
'no-undef': 'off',
|
|
125
|
+
|
|
126
|
+
// Enable TS rules
|
|
127
|
+
'@typescript-eslint/no-unused-vars': [
|
|
128
|
+
'error',
|
|
129
|
+
{
|
|
130
|
+
argsIgnorePattern: '^_',
|
|
131
|
+
varsIgnorePattern: '^_',
|
|
132
|
+
caughtErrorsIgnorePattern: '^_',
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
136
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
137
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
138
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'error',
|
|
139
|
+
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
140
|
+
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
// Test files configuration
|
|
145
|
+
{
|
|
146
|
+
files: ['**/*.test.{js,ts}', '**/*.spec.{js,ts}', '**/tests/**/*'],
|
|
147
|
+
languageOptions: {
|
|
148
|
+
globals: {
|
|
149
|
+
...globals.jest,
|
|
150
|
+
...globals.vitest,
|
|
151
|
+
describe: 'readonly',
|
|
152
|
+
it: 'readonly',
|
|
153
|
+
test: 'readonly',
|
|
154
|
+
expect: 'readonly',
|
|
155
|
+
beforeEach: 'readonly',
|
|
156
|
+
afterEach: 'readonly',
|
|
157
|
+
beforeAll: 'readonly',
|
|
158
|
+
afterAll: 'readonly',
|
|
159
|
+
vi: 'readonly',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
rules: {
|
|
163
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
164
|
+
'no-console': 'off',
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
// Configuration files
|
|
169
|
+
{
|
|
170
|
+
files: ['**/*.config.{js,ts}', '**/.*rc.{js,ts}'],
|
|
171
|
+
rules: {
|
|
172
|
+
'no-console': 'off',
|
|
173
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
// Ignore patterns
|
|
178
|
+
{
|
|
179
|
+
ignores: [
|
|
180
|
+
'build/**',
|
|
181
|
+
'coverage/**',
|
|
182
|
+
'dist/**',
|
|
183
|
+
'node_modules/**',
|
|
184
|
+
'public/**',
|
|
185
|
+
'storybook-static/**',
|
|
186
|
+
'.nuxt/**',
|
|
187
|
+
'.output/**',
|
|
188
|
+
'**/*.min.js',
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
]
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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/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
|
+
})
|
package/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zairakai/dev-tools
|
|
3
|
+
* Development tools umbrella — ESLint, Prettier, Stylelint, TypeScript, Vitest all-in-one.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import eslint from './config/eslint.config.js'
|
|
7
|
+
import prettier from './config/prettier.config.js'
|
|
8
|
+
import stylelint from './config/stylelint.config.js'
|
|
9
|
+
import tsconfig from './config/tsconfig.base.json' with { type: 'json' }
|
|
10
|
+
import vitest from './config/vitest.config.js'
|
|
11
|
+
|
|
12
|
+
// Named exports
|
|
13
|
+
export { eslint, prettier, stylelint, tsconfig, vitest }
|
|
14
|
+
|
|
15
|
+
// Named paths for consumers
|
|
16
|
+
export const configs = {
|
|
17
|
+
eslint: '@zairakai/dev-tools/config/eslint.config.js',
|
|
18
|
+
prettier: '@zairakai/dev-tools/config/prettier.config.js',
|
|
19
|
+
stylelint: '@zairakai/dev-tools/config/stylelint.config.js',
|
|
20
|
+
vitest: '@zairakai/dev-tools/config/vitest.config.js',
|
|
21
|
+
tsconfig: '@zairakai/dev-tools/config/tsconfig.base.json',
|
|
22
|
+
}
|