Skip to content

Commit f845ac7

Browse files
committed
Update development environment and build configuration
- Update ESLint configuration with @stylistic/eslint-plugin - Add tests directory to TypeScript include paths - Adjust Vite build configuration for ES modules output
1 parent dff9d9a commit f845ac7

4 files changed

Lines changed: 92 additions & 149 deletions

File tree

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.DS_Store
2-
CLAUDE.md
2+
.vscode/
33
dist/
4-
node_modules/
4+
node_modules/

eslint.config.js

Lines changed: 83 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,214 +1,155 @@
1+
// @ts-check
2+
import { defineConfig } from 'eslint/config';
3+
import eslint from '@eslint/js';
14
import tseslint from 'typescript-eslint';
5+
import stylistic from '@stylistic/eslint-plugin';
26

3-
export default tseslint.config(
7+
export default defineConfig(
48
{
5-
ignores: ['dist']
9+
ignores: [
10+
'dist',
11+
'eslint.config.js',
12+
'vite.config.ts',
13+
'vitest.config.ts'
14+
]
615
},
7-
...tseslint.configs.strict,
8-
...tseslint.configs.stylistic,
16+
eslint.configs.recommended,
17+
tseslint.configs.strictTypeChecked,
18+
tseslint.configs.stylisticTypeChecked,
919
{
10-
files: ['src/**/*.ts'],
20+
plugins: {
21+
'@stylistic': stylistic
22+
},
1123
languageOptions: {
1224
ecmaVersion: 2015,
1325
sourceType: 'module',
14-
globals: {
15-
self: 'readonly'
16-
},
1726
parserOptions: {
18-
project: './tsconfig.json'
27+
projectService: true
1928
}
2029
},
2130
rules: {
31+
'@typescript-eslint/no-confusing-void-expression': ['error', { ignoreArrowShorthand: true }],
2232
'@typescript-eslint/no-extraneous-class': 'off',
23-
'@typescript-eslint/no-unused-vars': ['error', { 'caughtErrors': 'none' }],
24-
'@typescript-eslint/unified-signatures': ['error', { 'ignoreDifferentlyNamedParameters': true }],
25-
'array-bracket-spacing': ['warn', 'never'],
26-
'array-callback-return': 'error',
27-
'constructor-super': 'error',
28-
'for-direction': 'error',
29-
'getter-return': 'error',
30-
'no-async-promise-executor': 'error',
31-
'no-class-assign': 'error',
32-
'no-compare-neg-zero': 'error',
33-
'no-cond-assign': 'error',
34-
'no-const-assign': 'error',
35-
'no-constant-binary-expression': 'error',
36-
'no-constant-condition': 'error',
37-
'no-constructor-return': 'error',
38-
'no-control-regex': 'error',
39-
'no-debugger': 'error',
40-
'no-dupe-args': 'error',
41-
'no-dupe-class-members': 'error',
42-
'no-dupe-else-if': 'error',
43-
'no-dupe-keys': 'error',
44-
'no-duplicate-case': 'error',
45-
'no-empty-character-class': 'error',
46-
'no-empty-pattern': 'error',
47-
'no-ex-assign': 'error',
48-
'no-fallthrough': 'error',
49-
'no-func-assign': 'error',
50-
'no-import-assign': 'error',
51-
'no-inner-declarations': 'error',
52-
'no-invalid-regexp': 'error',
53-
'no-irregular-whitespace': 'error',
54-
'no-loss-of-precision': 'error',
55-
'no-misleading-character-class': 'error',
56-
'no-new-native-nonconstructor': 'error',
57-
'no-new-symbol': 'error',
58-
'no-obj-calls': 'error',
59-
'no-self-assign': 'error',
60-
'no-self-compare': 'error',
61-
'no-setter-return': 'error',
62-
'no-sparse-arrays': 'error',
63-
'no-template-curly-in-string': 'error',
64-
'no-this-before-super': 'error',
65-
'no-undef': 'error',
66-
'no-unexpected-multiline': 'error',
67-
'no-unmodified-loop-condition': 'error',
68-
'no-unreachable': 'error',
69-
'no-unreachable-loop': 'error',
70-
'no-unsafe-finally': 'error',
71-
'no-unsafe-negation': 'error',
72-
'no-unsafe-optional-chaining': 'error',
73-
'no-unused-private-class-members': 'error',
74-
'no-use-before-define': 'error',
75-
'no-useless-backreference': 'error',
76-
'require-atomic-updates': 'error',
77-
'use-isnan': 'error',
78-
'valid-typeof': 'error',
33+
'@typescript-eslint/no-unused-vars': ['error', { caughtErrors: 'none' }],
34+
'@typescript-eslint/restrict-template-expressions': ['error', { allowNever: true }],
35+
'@typescript-eslint/unified-signatures': ['error', { ignoreDifferentlyNamedParameters: true }],
36+
7937
'accessor-pairs': 'error',
38+
'array-callback-return': 'error',
8039
'block-scoped-var': 'error',
8140
'consistent-return': 'error',
8241
'curly': 'error',
8342
'default-case-last': 'error',
84-
'dot-notation': 'error',
8543
'eqeqeq': ['error', 'smart'],
8644
'func-name-matching': 'error',
87-
'func-style': ['error', 'expression', { 'overrides': { 'namedExports': 'ignore' } }],
45+
'func-style': ['error', 'expression', { overrides: { namedExports: 'ignore' } }],
8846
'grouped-accessor-pairs': 'error',
89-
'id-denylist': 'error',
90-
'id-match': 'error',
9147
'max-depth': 'error',
9248
'max-nested-callbacks': 'error',
9349
'new-cap': 'error',
94-
'no-array-constructor': 'error',
9550
'no-caller': 'error',
96-
'no-delete-var': 'error',
51+
'no-constructor-return': 'error',
9752
'no-div-regex': 'error',
9853
'no-else-return': 'error',
9954
'no-empty-static-block': 'error',
10055
'no-eval': 'error',
10156
'no-extend-native': 'error',
10257
'no-extra-bind': 'error',
103-
'no-extra-boolean-cast': 'error',
10458
'no-extra-label': 'error',
105-
'no-extra-semi': 'error',
106-
'no-floating-decimal': 'error',
107-
'no-global-assign': 'error',
10859
'no-implicit-globals': 'error',
10960
'no-implied-eval': 'error',
11061
'no-iterator': 'error',
11162
'no-label-var': 'error',
11263
'no-labels': 'error',
11364
'no-lone-blocks': 'error',
11465
'no-lonely-if': 'error',
115-
'no-loop-func': 'error',
116-
'no-multi-assign': ['error', { 'ignoreNonDeclaration': true }],
66+
'no-multi-assign': ['error', { ignoreNonDeclaration: true }],
11767
'no-multi-str': 'error',
11868
'no-negated-condition': 'error',
11969
'no-new': 'error',
12070
'no-new-func': 'error',
121-
'no-new-object': 'error',
12271
'no-new-wrappers': 'error',
123-
'no-nonoctal-decimal-escape': 'error',
124-
'no-octal': 'error',
72+
'no-object-constructor': 'error',
12573
'no-octal-escape': 'error',
12674
'no-proto': 'error',
127-
'no-regex-spaces': 'error',
128-
'no-restricted-exports': 'error',
129-
'no-restricted-globals': 'error',
130-
'no-restricted-imports': 'error',
131-
'no-restricted-properties': 'error',
132-
'no-restricted-syntax': 'error',
13375
'no-return-assign': 'error',
134-
'no-return-await': 'error',
13576
'no-script-url': 'error',
77+
'no-self-compare': 'error',
13678
'no-sequences': 'error',
137-
'no-shadow': 'error',
13879
'no-shadow-restricted-names': 'error',
139-
'no-throw-literal': 'error',
80+
'no-template-curly-in-string': 'error',
14081
'no-undef-init': 'error',
82+
'no-unmodified-loop-condition': 'error',
14183
'no-unneeded-ternary': 'error',
142-
'no-unused-expressions': 'error',
143-
'no-unused-labels': 'error',
84+
'no-unreachable-loop': 'error',
14485
'no-useless-call': 'error',
145-
'no-useless-catch': 'error',
14686
'no-useless-computed-key': 'error',
14787
'no-useless-concat': 'error',
148-
'no-useless-escape': 'error',
14988
'no-useless-rename': 'error',
15089
'no-useless-return': 'error',
15190
'no-void': 'error',
152-
'no-warning-comments': 'warn',
153-
'no-with': 'error',
91+
'no-warning-comments': 'error',
15492
'operator-assignment': 'error',
155-
'prefer-const': 'error',
15693
'prefer-exponentiation-operator': 'error',
15794
'prefer-numeric-literals': 'error',
15895
'prefer-object-has-own': 'error',
15996
'prefer-object-spread': 'error',
160-
'prefer-promise-reject-errors': ['error', { 'allowEmptyReject': true }],
97+
'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],
16198
'prefer-regex-literals': 'error',
16299
'prefer-rest-params': 'error',
163100
'prefer-spread': 'error',
164101
'radix': 'error',
165-
'require-await': 'error',
166-
'require-yield': 'error',
102+
'require-atomic-updates': 'error',
167103
'symbol-description': 'error',
104+
'unicode-bom': 'error',
168105
'yoda': 'error',
169-
'arrow-spacing': 'warn',
170-
'block-spacing': 'warn',
171-
'comma-dangle': 'warn',
172-
'comma-spacing': 'warn',
173-
'comma-style': 'warn',
174-
'computed-property-spacing': 'warn',
175-
'dot-location': ['warn', 'property'],
176-
'eol-last': 'warn',
177-
'func-call-spacing': 'warn',
178-
'generator-star-spacing': 'warn',
179-
'implicit-arrow-linebreak': 'warn',
180-
'indent': ['warn', 2, { 'ignoreComments': true }],
181-
'jsx-quotes': 'warn',
182-
'key-spacing': 'warn',
183-
'keyword-spacing': 'warn',
184-
'linebreak-style': 'warn',
185-
'lines-between-class-members': 'warn',
186-
'new-parens': 'warn',
187-
'no-extra-parens': ['warn', 'functions'],
188-
'no-mixed-spaces-and-tabs': 'warn',
189-
'no-multi-spaces': ['warn', { 'ignoreEOLComments': true }],
190-
'no-tabs': 'warn',
191-
'no-trailing-spaces': 'warn',
192-
'no-whitespace-before-property': 'warn',
193-
'nonblock-statement-body-position': 'warn',
194-
'object-curly-newline': 'warn',
195-
'object-curly-spacing': ['warn', 'always'],
196-
'padding-line-between-statements': 'warn',
197-
'quotes': ['warn', 'single'],
198-
'rest-spread-spacing': 'warn',
199-
'semi': 'warn',
200-
'semi-spacing': 'warn',
201-
'semi-style': 'warn',
202-
'space-before-blocks': 'warn',
203-
'space-in-parens': 'warn',
204-
'space-infix-ops': 'warn',
205-
'space-unary-ops': 'warn',
206-
'switch-colon-spacing': 'warn',
207-
'template-curly-spacing': 'warn',
208-
'template-tag-spacing': 'warn',
209-
'unicode-bom': 'warn',
210-
'wrap-iife': ['warn', 'any'],
211-
'yield-star-spacing': 'warn'
106+
107+
'@stylistic/array-bracket-spacing': ['warn', 'never'],
108+
'@stylistic/arrow-spacing': 'warn',
109+
'@stylistic/block-spacing': 'warn',
110+
'@stylistic/comma-dangle': 'warn',
111+
'@stylistic/comma-spacing': 'warn',
112+
'@stylistic/comma-style': 'warn',
113+
'@stylistic/computed-property-spacing': 'warn',
114+
'@stylistic/dot-location': ['warn', 'property'],
115+
'@stylistic/eol-last': 'warn',
116+
'@stylistic/function-call-spacing': 'warn',
117+
'@stylistic/generator-star-spacing': 'warn',
118+
'@stylistic/implicit-arrow-linebreak': 'warn',
119+
'@stylistic/indent': ['warn', 2, { ignoreComments: true }],
120+
'@stylistic/jsx-quotes': 'warn',
121+
'@stylistic/key-spacing': 'warn',
122+
'@stylistic/keyword-spacing': 'warn',
123+
'@stylistic/linebreak-style': 'warn',
124+
'@stylistic/lines-between-class-members': 'warn',
125+
'@stylistic/member-delimiter-style': ['warn', { multiline: { delimiter: 'semi', requireLast: true }, singleline: { delimiter: 'semi', requireLast: false } }],
126+
'@stylistic/new-parens': 'warn',
127+
'@stylistic/no-extra-parens': ['warn', 'functions'],
128+
'@stylistic/no-extra-semi': 'warn',
129+
'@stylistic/no-floating-decimal': 'warn',
130+
'@stylistic/no-mixed-spaces-and-tabs': 'warn',
131+
'@stylistic/no-multi-spaces': ['warn', { ignoreEOLComments: true }],
132+
'@stylistic/no-tabs': 'warn',
133+
'@stylistic/no-trailing-spaces': 'warn',
134+
'@stylistic/no-whitespace-before-property': 'warn',
135+
'@stylistic/nonblock-statement-body-position': 'warn',
136+
'@stylistic/object-curly-newline': 'warn',
137+
'@stylistic/object-curly-spacing': ['warn', 'always'],
138+
'@stylistic/padding-line-between-statements': 'warn',
139+
'@stylistic/quotes': ['warn', 'single'],
140+
'@stylistic/rest-spread-spacing': 'warn',
141+
'@stylistic/semi': 'warn',
142+
'@stylistic/semi-spacing': 'warn',
143+
'@stylistic/semi-style': 'warn',
144+
'@stylistic/space-before-blocks': 'warn',
145+
'@stylistic/space-in-parens': 'warn',
146+
'@stylistic/space-infix-ops': 'warn',
147+
'@stylistic/space-unary-ops': 'warn',
148+
'@stylistic/switch-colon-spacing': 'warn',
149+
'@stylistic/template-curly-spacing': 'warn',
150+
'@stylistic/template-tag-spacing': 'warn',
151+
'@stylistic/wrap-iife': ['warn', 'any'],
152+
'@stylistic/yield-star-spacing': 'warn'
212153
}
213154
}
214155
);

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@
105105
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
106106
"skipLibCheck": true /* Skip type checking all .d.ts files. */
107107
},
108-
"include": ["src"]
108+
"include": ["src", "tests"]
109109
}

vite.config.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,25 @@ export default defineConfig({
88
minify: false,
99
lib: {
1010
entry: 'src/index.ts',
11-
name: 'Blokr',
11+
name: 'blokr',
1212
formats: ['es', 'umd'],
1313
fileName: format => format === 'es' ? 'index.js' : 'blokr.js',
1414
},
1515
rollupOptions: {
1616
output: {
1717
exports: 'default',
1818
plugins: [
19-
terser(),
2019
license({
2120
banner: '@license\nCopyright 2025 KNOWLEDGECODE\nSPDX-License-Identifier: MIT'
22-
})
21+
}),
22+
terser()
2323
]
2424
}
2525
}
2626
},
2727
plugins: [
28-
dts()
28+
dts({
29+
include: ['src/**/*']
30+
})
2931
]
3032
});

0 commit comments

Comments
 (0)