@santi020k/eslint-config-santi020k 1.2.2 → 2.0.1

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/package.json CHANGED
@@ -1,26 +1,25 @@
1
1
  {
2
2
  "name": "@santi020k/eslint-config-santi020k",
3
- "version": "1.2.2",
3
+ "version": "2.0.1",
4
4
  "description": "A comprehensive ESLint configuration package for JavaScript, TypeScript, and React projects, including popular plugins and custom rules for consistent coding style.",
5
5
  "type": "module",
6
- "main": "./dist/cjs/index.cjs",
7
- "types": "./dist/cjs/index.d.cts",
6
+ "main": "./dist/index.js",
7
+ "typings": "./dist/index.d.ts",
8
8
  "exports": {
9
- "require": {
10
- "types": "./dist/cjs/index.d.cts",
11
- "default": "./dist/cjs/index.cjs"
9
+ ".": {
10
+ "types": "./index.d.ts",
11
+ "default": "./dist/index.js"
12
12
  },
13
- "import": {
14
- "types": "./dist/esm/index.d.mts",
15
- "default": "./dist/esm/index.mjs"
16
- }
13
+ "./package.json": "./package.json"
17
14
  },
18
15
  "files": [
19
16
  "/dist"
20
17
  ],
21
18
  "scripts": {
22
- "dev": "rollup -c --watch",
23
- "build": "rollup -c",
19
+ "build:clean": "rm -rf dist",
20
+ "build": "rollup --config rollup.config.js && rollup --config rollup.config.es.js",
21
+ "dev": "rollup --config rollup.config.js --watch",
22
+ "inspector": "npx @eslint/config-inspector@latest",
24
23
  "lint": "eslint . --report-unused-disable-directives",
25
24
  "lint:fix": "npm run lint -- --fix --max-warnings=0",
26
25
  "pre-commit": "lint-staged",
@@ -56,43 +55,54 @@
56
55
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
57
56
  },
58
57
  "devDependencies": {
58
+ "@eslint/config-inspector": "^0.5.0",
59
59
  "@rollup/plugin-node-resolve": "^15.2.3",
60
60
  "@rollup/plugin-typescript": "^11.1.6",
61
- "@types/node": "^20.14.2",
61
+ "@types/eslint__eslintrc": "^2.1.1",
62
+ "@types/node": "^20.14.8",
63
+ "@types/rollup-plugin-generate-package-json": "^3.2.9",
62
64
  "cz-conventional-changelog": "^3.3.0",
63
- "esbuild": "^0.21.4",
65
+ "esbuild": "^0.21.5",
64
66
  "husky": "^9.0.11",
65
- "lint-staged": "^15.2.5",
67
+ "lint-staged": "^15.2.7",
66
68
  "react": "^18.3.1",
67
69
  "react-dom": "^18.3.1",
68
70
  "rollup": "^4.18.0",
69
- "rollup-plugin-copy": "^3.5.0",
70
- "rollup-plugin-esbuild": "^6.1.1",
71
+ "rollup-plugin-generate-package-json": "^3.2.0",
72
+ "rollup-plugin-typescript2": "^0.36.0",
71
73
  "tslib": "^2.6.3",
72
- "typescript": "^5.4.5"
74
+ "typescript": "^5.5.2",
75
+ "yalc": "^1.0.0-pre.53"
73
76
  },
74
77
  "dependencies": {
75
- "@eslint/compat": "^1.0.3",
76
- "@eslint/js": "^9.4.0",
77
- "@next/eslint-plugin-next": "^14.2.3",
78
- "@stylistic/eslint-plugin": "^2.1.0",
78
+ "@cspell/eslint-plugin": "^8.9.1",
79
+ "@eslint/compat": "^1.1.0",
80
+ "@eslint/js": "^9.5.0",
81
+ "@next/eslint-plugin-next": "^14.2.4",
82
+ "@stylistic/eslint-plugin": "^2.2.2",
79
83
  "@types/eslint__js": "^8.42.3",
80
- "@typescript-eslint/eslint-plugin": "^7.12.0",
81
- "@typescript-eslint/type-utils": "^7.12.0",
84
+ "@typescript-eslint/eslint-plugin": "^7.13.1",
85
+ "@typescript-eslint/type-utils": "^7.13.1",
86
+ "cross-dirname": "^0.1.0",
87
+ "eslint-config-expo": "^7.1.2",
82
88
  "eslint-config-standard": "^17.1.0",
83
- "eslint-plugin-astro": "^1.2.0",
89
+ "eslint-plugin-astro": "^1.2.2",
90
+ "eslint-plugin-i18next": "^6.0.3",
84
91
  "eslint-plugin-import": "^2.29.1",
85
- "eslint-plugin-jsx-a11y": "^6.8.0",
92
+ "eslint-plugin-jsx-a11y": "^6.9.0",
86
93
  "eslint-plugin-mdx": "^3.1.5",
87
- "eslint-plugin-n": "^17.8.0",
94
+ "eslint-plugin-n": "^17.9.0",
88
95
  "eslint-plugin-promise": "^6.2.0",
89
- "eslint-plugin-react": "^7.34.2",
96
+ "eslint-plugin-react": "^7.34.3",
90
97
  "eslint-plugin-react-hooks": "^4.6.2",
91
98
  "eslint-plugin-simple-import-sort": "^12.1.0",
92
99
  "eslint-plugin-sonarjs": "^1.0.3",
100
+ "eslint-plugin-tailwindcss": "^3.17.4",
101
+ "eslint-plugin-testing-library": "^6.2.2",
93
102
  "eslint-plugin-unused-imports": "^3.2.0",
94
- "globals": "^15.3.0",
95
- "typescript-eslint": "^7.12.0"
103
+ "eslint-plugin-vitest": "^0.5.4",
104
+ "globals": "^15.6.0",
105
+ "typescript-eslint": "^7.13.1"
96
106
  },
97
107
  "overrides": {
98
108
  "eslint-config-standard": "$eslint-config-standard",
@@ -1,443 +0,0 @@
1
- 'use strict';
2
-
3
- var eslint = require('@eslint/js');
4
- var pluginStylistic = require('@stylistic/eslint-plugin');
5
- var configStandard = require('eslint-config-standard');
6
- var pluginImport = require('eslint-plugin-import');
7
- var pluginJsxA11y = require('eslint-plugin-jsx-a11y');
8
- var pluginN = require('eslint-plugin-n');
9
- var pluginPromise = require('eslint-plugin-promise');
10
- var pluginSimpleImport = require('eslint-plugin-simple-import-sort');
11
- var pluginSonarJs = require('eslint-plugin-sonarjs');
12
- var pluginUnusedImport = require('eslint-plugin-unused-imports');
13
- var globals = require('globals');
14
- var compat = require('@eslint/compat');
15
- var pluginReactConfig = require('eslint-plugin-react/configs/recommended.js');
16
- var pluginReactHooks = require('eslint-plugin-react-hooks');
17
- var eslintrc = require('@eslint/eslintrc');
18
- var path = require('path');
19
- var url = require('url');
20
- var tseslint = require('typescript-eslint');
21
-
22
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
23
- const groups = [
24
- // Internal packages.
25
- ["^(store)(/.*|$)"],
26
- ["^(api)(/.*|$)"],
27
- ["^(components)(/.*|$)"],
28
- ["^(contexts)(/.*|$)"],
29
- ["^(hooks)(/.*|$)"],
30
- ["^(lib)(/.*|$)"],
31
- ["^(services)(/.*|$)"],
32
- ["^(models)(/.*|$)"],
33
- ["^(utils)(/.*|$)"],
34
- ["^(ws)(/.*|$)"],
35
- // Side effect imports.
36
- ["^\\u0000"],
37
- // Parent imports. Put `..` last.
38
- ["^\\.\\.(?!/?$)", "^\\.\\./?$"],
39
- // Other relative imports. Put same-folder imports and `.` last.
40
- ["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
41
- // Style imports.
42
- ["^.+\\.?(css)$"]
43
- ];
44
- const rules$5 = {
45
- "unused-imports/no-unused-imports": "warn",
46
- indent: "off",
47
- "brace-style": "off",
48
- "@stylistic/brace-style": ["warn", "1tbs"],
49
- "@stylistic/indent": ["warn", 2],
50
- "@stylistic/quote-props": ["warn", "as-needed"],
51
- quotes: "off",
52
- "@stylistic/quotes": ["warn", "single"],
53
- "@stylistic/semi": ["warn", "never"],
54
- "@stylistic/comma-dangle": ["warn", "never"],
55
- "@stylistic/object-curly-spacing": ["warn", "always"],
56
- "@stylistic/padded-blocks": ["warn", "never"],
57
- "@stylistic/arrow-parens": ["warn", "as-needed"],
58
- "@stylistic/dot-location": ["warn", "property"],
59
- "@stylistic/function-call-argument-newline": ["warn", "never"],
60
- "@stylistic/object-property-newline": [
61
- "warn",
62
- { allowAllPropertiesOnSameLine: true }
63
- ],
64
- "@stylistic/multiline-ternary": ["warn", "always-multiline"],
65
- "@stylistic/member-delimiter-style": ["error", {
66
- multiline: {
67
- delimiter: "none",
68
- requireLast: false
69
- },
70
- singleline: {
71
- delimiter: "comma",
72
- requireLast: false
73
- },
74
- overrides: {
75
- interface: {
76
- multiline: {
77
- delimiter: "none",
78
- requireLast: false
79
- }
80
- }
81
- }
82
- }],
83
- "@stylistic/no-extra-parens": "off",
84
- "@stylistic/max-len": [
85
- "warn",
86
- {
87
- code: 120,
88
- tabWidth: 2,
89
- comments: 200,
90
- ignoreStrings: true
91
- }
92
- ],
93
- "@stylistic/max-statements-per-line": ["warn", { max: 1 }],
94
- "@stylistic/array-element-newline": ["warn", "consistent"],
95
- "@stylistic/no-extra-semi": "off",
96
- "@stylistic/no-multi-spaces": "off",
97
- "@stylistic/padding-line-between-statements": [
98
- "warn",
99
- { blankLine: "always", prev: "*", next: "*" },
100
- { blankLine: "any", prev: "import", next: "import" },
101
- {
102
- blankLine: "always",
103
- prev: ["const", "let", "var"],
104
- next: ["const", "let", "var"]
105
- },
106
- {
107
- blankLine: "never",
108
- prev: ["singleline-const", "singleline-let", "singleline-var"],
109
- next: ["singleline-const", "singleline-let", "singleline-var"]
110
- },
111
- { blankLine: "always", prev: "block-like", next: "const" },
112
- { blankLine: "always", prev: "const", next: "block-like" }
113
- ],
114
- "@stylistic/function-paren-newline": ["warn", "consistent"],
115
- "arrow-body-style": ["warn", "as-needed"],
116
- "prefer-arrow-callback": ["warn", { allowNamedFunctions: true }],
117
- "func-style": ["warn", "expression", { allowArrowFunctions: true }],
118
- "simple-import-sort/imports": [
119
- "warn",
120
- {
121
- groups
122
- }
123
- ],
124
- "jsx-a11y/alt-text": "warn",
125
- "no-empty": "warn",
126
- "no-nested-ternary": "warn",
127
- "no-undef": "warn",
128
- "unused-imports/no-unused-vars": [
129
- "warn",
130
- {
131
- vars: "all",
132
- varsIgnorePattern: "^_",
133
- args: "after-used",
134
- argsIgnorePattern: "^_",
135
- destructuredArrayIgnorePattern: "^_",
136
- ignoreRestSiblings: true
137
- }
138
- ],
139
- "no-void": "warn",
140
- camelcase: "warn",
141
- "array-callback-return": "warn",
142
- "no-fallthrough": "warn",
143
- eqeqeq: "warn",
144
- "no-constant-binary-expression": "warn",
145
- "@stylistic/lines-around-comment": "warn",
146
- "import/no-duplicates": "warn",
147
- "valid-typeof": "warn",
148
- "no-constant-condition": "warn",
149
- "no-use-before-define": "warn",
150
- "@stylistic/implicit-arrow-linebreak": "warn",
151
- "import/export": "warn",
152
- "no-useless-escape": "warn",
153
- "no-useless-return": "warn",
154
- "prefer-promise-reject-errors": "warn",
155
- "no-useless-constructor": "warn",
156
- "no-new": "warn",
157
- "prefer-regex-literals": "warn",
158
- "@stylistic/multiline-comment-style": "off",
159
- "space-before-function-paren": "off"
160
- };
161
-
162
- const languageOptions$1 = {
163
- ecmaVersion: "latest",
164
- sourceType: "module",
165
- globals: {
166
- ...globals.browser,
167
- ...globals.node
168
- }
169
- };
170
- const jsConfig = [
171
- {
172
- name: "eslint-config",
173
- ...eslint.configs.recommended
174
- },
175
- {
176
- name: "plugins",
177
- plugins: {
178
- n: pluginN,
179
- promise: pluginPromise,
180
- import: { rules: pluginImport.rules },
181
- "simple-import-sort": pluginSimpleImport,
182
- "jsx-a11y": pluginJsxA11y,
183
- "unused-imports": pluginUnusedImport,
184
- sonarjs: pluginSonarJs
185
- },
186
- languageOptions: languageOptions$1,
187
- rules: {
188
- ...configStandard.rules,
189
- ...pluginSonarJs.configs.recommended.rules,
190
- "import/first": "off"
191
- }
192
- },
193
- {
194
- name: "stylistic",
195
- ...pluginStylistic.configs["recommended-flat"]
196
- },
197
- {
198
- name: "custom",
199
- languageOptions: languageOptions$1,
200
- files: ["**/*.{js,jsx,mjs,cjs}"],
201
- rules: rules$5
202
- }
203
- ];
204
-
205
- const rules$4 = {
206
- ...rules$5,
207
- "react/react-in-jsx-scope": "off",
208
- "react/jsx-max-depth": ["warn", { max: 7 }],
209
- "react/prop-types": "off",
210
- "react-hooks/exhaustive-deps": "off",
211
- "react/button-has-type": "warn",
212
- "react/display-name": "warn",
213
- "react/no-children-prop": "warn",
214
- "react/no-danger-with-children": "warn",
215
- "react/no-unstable-nested-components": "warn",
216
- "react/self-closing-comp": ["warn", { component: true, html: true }],
217
- "react/jsx-curly-brace-presence": [
218
- "warn",
219
- { props: "never", children: "never" }
220
- ],
221
- "react/jsx-curly-newline": "warn",
222
- "react/destructuring-assignment": "warn",
223
- "react/jsx-pascal-case": "warn",
224
- "react/boolean-prop-naming": "warn",
225
- "react/hook-use-state": "warn",
226
- "react/jsx-boolean-value": "warn",
227
- "react/jsx-closing-tag-location": "warn",
228
- "react/jsx-closing-bracket-location": "warn",
229
- "react/jsx-wrap-multilines": "warn",
230
- "react/jsx-no-target-blank": "warn",
231
- "react/jsx-no-leaked-render": "warn",
232
- "react/jsx-handler-names": "warn",
233
- "react/jsx-fragments": "warn",
234
- "react/no-deprecated": "warn",
235
- "react/no-multi-comp": "warn",
236
- "react/no-unescaped-entities": "warn",
237
- "react/jsx-no-undef": "warn",
238
- "react/no-unknown-property": "warn",
239
- "simple-import-sort/imports": [
240
- "warn",
241
- {
242
- groups: [
243
- // Packages `react` related packages come first.
244
- ["^react"],
245
- ...groups
246
- ]
247
- }
248
- ]
249
- };
250
-
251
- const languageOptions = {
252
- ecmaVersion: "latest",
253
- sourceType: "module",
254
- ...pluginReactConfig.languageOptions,
255
- globals: {
256
- ...globals.browser,
257
- ...globals.node
258
- }
259
- };
260
- const reactConfig = [
261
- ...jsConfig,
262
- ...compat.fixupConfigRules(pluginReactConfig).map((react) => ({
263
- ...react,
264
- name: "react",
265
- languageOptions,
266
- settings: {
267
- react: {
268
- version: "detect"
269
- }
270
- }
271
- })),
272
- {
273
- name: "custom-react",
274
- plugins: {
275
- "react-hooks": pluginReactHooks
276
- },
277
- languageOptions,
278
- files: ["**/*.{js,jsx,mjs,cjs}"],
279
- rules: {
280
- ...configStandard.rules,
281
- ...pluginSonarJs.configs.recommended.rules,
282
- ...pluginReactHooks.configs.recommended.rules,
283
- ...rules$4
284
- }
285
- }
286
- ];
287
-
288
- const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
289
- const __dirname$1 = path.dirname(__filename$1);
290
- const flatCompat = new eslintrc.FlatCompat({
291
- baseDirectory: __dirname$1,
292
- recommendedConfig: {}
293
- });
294
-
295
- const astroConfig = [
296
- ...reactConfig,
297
- ...compat.fixupConfigRules(flatCompat.config({
298
- overrides: [
299
- {
300
- files: ["*.astro"],
301
- parser: "astro-eslint-parser"
302
- },
303
- {
304
- files: ["*.md", "*.mdx"],
305
- extends: ["plugin:mdx/recommended"],
306
- settings: {
307
- "mdx/code-blocks": true,
308
- "mdx/language-mapper": {}
309
- },
310
- rules: {
311
- "max-len": "off",
312
- "react/react-in-jsx-scope": "off"
313
- }
314
- }
315
- ]
316
- }))
317
- ];
318
-
319
- const rules$3 = {
320
- ...rules$5,
321
- semi: "off",
322
- "no-unused-vars": "off",
323
- "@typescript-eslint/indent": "off",
324
- "@typescript-eslint/no-unused-vars": [
325
- "warn",
326
- {
327
- vars: "all",
328
- varsIgnorePattern: "^_",
329
- args: "after-used",
330
- argsIgnorePattern: "^_",
331
- destructuredArrayIgnorePattern: "^_",
332
- ignoreRestSiblings: true
333
- }
334
- ],
335
- "@typescript-eslint/no-explicit-any": "warn",
336
- "@typescript-eslint/no-empty-function": "warn",
337
- "@typescript-eslint/ban-types": "warn",
338
- "@typescript-eslint/no-var-requires": "warn",
339
- "@typescript-eslint/ban-ts-comment": "warn",
340
- "@typescript-eslint/no-non-null-assertion": "warn",
341
- "@typescript-eslint/no-invalid-void-type": "warn",
342
- "@typescript-eslint/no-dynamic-delete": "warn",
343
- "@typescript-eslint/no-useless-constructor": "warn",
344
- "@typescript-eslint/prefer-for-of": "warn",
345
- "@typescript-eslint/no-duplicate-enum-values": "warn"
346
- };
347
-
348
- const tsConfig = [
349
- ...jsConfig,
350
- ...tseslint.configs.strict,
351
- ...tseslint.configs.stylistic,
352
- {
353
- name: "custom-ts",
354
- files: ["**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}"],
355
- rules: rules$3
356
- }
357
- ];
358
-
359
- const rules$2 = {
360
- ...rules$4,
361
- ...rules$3
362
- };
363
-
364
- const reactTsConfig = [
365
- ...reactConfig,
366
- ...tsConfig,
367
- {
368
- name: "custom-react-ts",
369
- rules: rules$2
370
- }
371
- ];
372
-
373
- const astroTsConfig = [
374
- ...reactTsConfig,
375
- ...astroConfig,
376
- ...compat.fixupConfigRules(flatCompat.config({
377
- overrides: [{
378
- files: ["*.astro"],
379
- parser: "astro-eslint-parser",
380
- plugins: ["@typescript-eslint"],
381
- rules: {
382
- "@typescript-eslint/strict-boolean-expressions": "off"
383
- }
384
- }]
385
- }))
386
- ];
387
-
388
- const rules$1 = {
389
- ...rules$4,
390
- "simple-import-sort/imports": [
391
- "warn",
392
- {
393
- groups: [
394
- // Packages `react` related packages come first.
395
- ["^react"],
396
- ["^next"],
397
- ...groups
398
- ]
399
- }
400
- ]
401
- };
402
-
403
- const nextConfig = [
404
- ...reactConfig,
405
- ...compat.fixupConfigRules(flatCompat.extends("plugin:@next/next/core-web-vitals")),
406
- {
407
- name: "custom-next",
408
- rules: rules$1
409
- }
410
- ];
411
-
412
- const rules = {
413
- ...rules$4,
414
- "simple-import-sort/imports": [
415
- "warn",
416
- {
417
- groups: [
418
- // Packages `react` related packages come first.
419
- ["^react"],
420
- ["^next"],
421
- ...groups
422
- ]
423
- }
424
- ]
425
- };
426
-
427
- const nextTsConfig = [
428
- ...nextConfig,
429
- ...reactTsConfig,
430
- {
431
- name: "custom-next-ts",
432
- rules
433
- }
434
- ];
435
-
436
- exports.astroEslint = astroConfig;
437
- exports.astroTsEslint = astroTsConfig;
438
- exports.jsEslint = jsConfig;
439
- exports.nextEslint = nextConfig;
440
- exports.nextTsEslint = nextTsConfig;
441
- exports.reactEslint = reactConfig;
442
- exports.reactTsEslint = reactTsConfig;
443
- exports.tsEslint = tsConfig;