@santi020k/eslint-config-santi020k 1.2.1 → 2.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.
package/package.json CHANGED
@@ -1,26 +1,25 @@
1
1
  {
2
2
  "name": "@santi020k/eslint-config-santi020k",
3
- "version": "1.2.1",
3
+ "version": "2.0.0",
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,441 +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
- "@stylistic/indent": ["warn", 2],
47
- "@stylistic/quote-props": ["warn", "as-needed"],
48
- quotes: "off",
49
- "@stylistic/quotes": ["warn", "single"],
50
- "@stylistic/semi": ["warn", "never"],
51
- "@stylistic/comma-dangle": ["warn", "never"],
52
- "@stylistic/object-curly-spacing": ["warn", "always"],
53
- "@stylistic/padded-blocks": ["warn", "never"],
54
- "@stylistic/arrow-parens": ["warn", "as-needed"],
55
- "@stylistic/dot-location": ["warn", "property"],
56
- "@stylistic/function-call-argument-newline": ["warn", "never"],
57
- "@stylistic/object-property-newline": [
58
- "warn",
59
- { allowAllPropertiesOnSameLine: true }
60
- ],
61
- "@stylistic/multiline-ternary": ["warn", "always-multiline"],
62
- "@stylistic/member-delimiter-style": ["error", {
63
- multiline: {
64
- delimiter: "none",
65
- requireLast: false
66
- },
67
- singleline: {
68
- delimiter: "comma",
69
- requireLast: false
70
- },
71
- overrides: {
72
- interface: {
73
- multiline: {
74
- delimiter: "none",
75
- requireLast: false
76
- }
77
- }
78
- }
79
- }],
80
- "@stylistic/no-extra-parens": "off",
81
- "@stylistic/max-len": [
82
- "warn",
83
- {
84
- code: 120,
85
- tabWidth: 2,
86
- comments: 200,
87
- ignoreStrings: true
88
- }
89
- ],
90
- "@stylistic/max-statements-per-line": ["warn", { max: 1 }],
91
- "@stylistic/array-element-newline": ["warn", "consistent"],
92
- "@stylistic/no-extra-semi": "off",
93
- "@stylistic/no-multi-spaces": "off",
94
- "@stylistic/padding-line-between-statements": [
95
- "warn",
96
- { blankLine: "always", prev: "*", next: "*" },
97
- { blankLine: "any", prev: "import", next: "import" },
98
- {
99
- blankLine: "always",
100
- prev: ["const", "let", "var"],
101
- next: ["const", "let", "var"]
102
- },
103
- {
104
- blankLine: "never",
105
- prev: ["singleline-const", "singleline-let", "singleline-var"],
106
- next: ["singleline-const", "singleline-let", "singleline-var"]
107
- },
108
- { blankLine: "always", prev: "block-like", next: "const" },
109
- { blankLine: "always", prev: "const", next: "block-like" }
110
- ],
111
- "@stylistic/function-paren-newline": ["warn", "consistent"],
112
- "arrow-body-style": ["warn", "as-needed"],
113
- "prefer-arrow-callback": ["warn", { allowNamedFunctions: true }],
114
- "func-style": ["warn", "expression", { allowArrowFunctions: true }],
115
- "simple-import-sort/imports": [
116
- "warn",
117
- {
118
- groups
119
- }
120
- ],
121
- "jsx-a11y/alt-text": "warn",
122
- "no-empty": "warn",
123
- "no-nested-ternary": "warn",
124
- "no-undef": "warn",
125
- "unused-imports/no-unused-vars": [
126
- "warn",
127
- {
128
- vars: "all",
129
- varsIgnorePattern: "^_",
130
- args: "after-used",
131
- argsIgnorePattern: "^_",
132
- destructuredArrayIgnorePattern: "^_",
133
- ignoreRestSiblings: true
134
- }
135
- ],
136
- "no-void": "warn",
137
- camelcase: "warn",
138
- "array-callback-return": "warn",
139
- "no-fallthrough": "warn",
140
- eqeqeq: "warn",
141
- "no-constant-binary-expression": "warn",
142
- "@stylistic/lines-around-comment": "warn",
143
- "import/no-duplicates": "warn",
144
- "valid-typeof": "warn",
145
- "no-constant-condition": "warn",
146
- "no-use-before-define": "warn",
147
- "@stylistic/implicit-arrow-linebreak": "warn",
148
- "import/export": "warn",
149
- "no-useless-escape": "warn",
150
- "@stylistic/brace-style": "warn",
151
- "no-useless-return": "warn",
152
- "prefer-promise-reject-errors": "warn",
153
- "no-useless-constructor": "warn",
154
- "no-new": "warn",
155
- "prefer-regex-literals": "warn",
156
- "@stylistic/multiline-comment-style": "off",
157
- "space-before-function-paren": "off"
158
- };
159
-
160
- const languageOptions$1 = {
161
- ecmaVersion: "latest",
162
- sourceType: "module",
163
- globals: {
164
- ...globals.browser,
165
- ...globals.node
166
- }
167
- };
168
- const jsConfig = [
169
- {
170
- name: "eslint-config",
171
- ...eslint.configs.recommended
172
- },
173
- {
174
- name: "plugins",
175
- plugins: {
176
- n: pluginN,
177
- promise: pluginPromise,
178
- import: { rules: pluginImport.rules },
179
- "simple-import-sort": pluginSimpleImport,
180
- "jsx-a11y": pluginJsxA11y,
181
- "unused-imports": pluginUnusedImport,
182
- sonarjs: pluginSonarJs
183
- },
184
- languageOptions: languageOptions$1,
185
- rules: {
186
- ...configStandard.rules,
187
- ...pluginSonarJs.configs.recommended.rules,
188
- "import/first": "off"
189
- }
190
- },
191
- {
192
- name: "stylistic",
193
- ...pluginStylistic.configs["recommended-flat"]
194
- },
195
- {
196
- name: "custom",
197
- languageOptions: languageOptions$1,
198
- files: ["**/*.{js,jsx,mjs,cjs}"],
199
- rules: rules$5
200
- }
201
- ];
202
-
203
- const rules$4 = {
204
- ...rules$5,
205
- "react/react-in-jsx-scope": "off",
206
- "react/jsx-max-depth": ["warn", { max: 7 }],
207
- "react/prop-types": "off",
208
- "react-hooks/exhaustive-deps": "off",
209
- "react/button-has-type": "warn",
210
- "react/display-name": "warn",
211
- "react/no-children-prop": "warn",
212
- "react/no-danger-with-children": "warn",
213
- "react/no-unstable-nested-components": "warn",
214
- "react/self-closing-comp": ["warn", { component: true, html: true }],
215
- "react/jsx-curly-brace-presence": [
216
- "warn",
217
- { props: "never", children: "never" }
218
- ],
219
- "react/jsx-curly-newline": "warn",
220
- "react/destructuring-assignment": "warn",
221
- "react/jsx-pascal-case": "warn",
222
- "react/boolean-prop-naming": "warn",
223
- "react/hook-use-state": "warn",
224
- "react/jsx-boolean-value": "warn",
225
- "react/jsx-closing-tag-location": "warn",
226
- "react/jsx-closing-bracket-location": "warn",
227
- "react/jsx-wrap-multilines": "warn",
228
- "react/jsx-no-target-blank": "warn",
229
- "react/jsx-no-leaked-render": "warn",
230
- "react/jsx-handler-names": "warn",
231
- "react/jsx-fragments": "warn",
232
- "react/no-deprecated": "warn",
233
- "react/no-multi-comp": "warn",
234
- "react/no-unescaped-entities": "warn",
235
- "react/jsx-no-undef": "warn",
236
- "react/no-unknown-property": "warn",
237
- "simple-import-sort/imports": [
238
- "warn",
239
- {
240
- groups: [
241
- // Packages `react` related packages come first.
242
- ["^react"],
243
- ...groups
244
- ]
245
- }
246
- ]
247
- };
248
-
249
- const languageOptions = {
250
- ecmaVersion: "latest",
251
- sourceType: "module",
252
- ...pluginReactConfig.languageOptions,
253
- globals: {
254
- ...globals.browser,
255
- ...globals.node
256
- }
257
- };
258
- const reactConfig = [
259
- ...jsConfig,
260
- ...compat.fixupConfigRules(pluginReactConfig).map((react) => ({
261
- ...react,
262
- name: "react",
263
- languageOptions,
264
- settings: {
265
- react: {
266
- version: "detect"
267
- }
268
- }
269
- })),
270
- {
271
- name: "custom-react",
272
- plugins: {
273
- "react-hooks": pluginReactHooks
274
- },
275
- languageOptions,
276
- files: ["**/*.{js,jsx,mjs,cjs}"],
277
- rules: {
278
- ...configStandard.rules,
279
- ...pluginSonarJs.configs.recommended.rules,
280
- ...pluginReactHooks.configs.recommended.rules,
281
- ...rules$4
282
- }
283
- }
284
- ];
285
-
286
- const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
287
- const __dirname$1 = path.dirname(__filename$1);
288
- const flatCompat = new eslintrc.FlatCompat({
289
- baseDirectory: __dirname$1,
290
- recommendedConfig: {}
291
- });
292
-
293
- const astroConfig = [
294
- ...reactConfig,
295
- ...compat.fixupConfigRules(flatCompat.config({
296
- overrides: [
297
- {
298
- files: ["*.astro"],
299
- parser: "astro-eslint-parser"
300
- },
301
- {
302
- files: ["*.md", "*.mdx"],
303
- extends: ["plugin:mdx/recommended"],
304
- settings: {
305
- "mdx/code-blocks": true,
306
- "mdx/language-mapper": {}
307
- },
308
- rules: {
309
- "max-len": "off",
310
- "react/react-in-jsx-scope": "off"
311
- }
312
- }
313
- ]
314
- }))
315
- ];
316
-
317
- const rules$3 = {
318
- ...rules$5,
319
- semi: "off",
320
- "no-unused-vars": "off",
321
- "@typescript-eslint/indent": "off",
322
- "@typescript-eslint/no-unused-vars": [
323
- "warn",
324
- {
325
- vars: "all",
326
- varsIgnorePattern: "^_",
327
- args: "after-used",
328
- argsIgnorePattern: "^_",
329
- destructuredArrayIgnorePattern: "^_",
330
- ignoreRestSiblings: true
331
- }
332
- ],
333
- "@typescript-eslint/no-explicit-any": "warn",
334
- "@typescript-eslint/no-empty-function": "warn",
335
- "@typescript-eslint/ban-types": "warn",
336
- "@typescript-eslint/no-var-requires": "warn",
337
- "@typescript-eslint/ban-ts-comment": "warn",
338
- "@typescript-eslint/no-non-null-assertion": "warn",
339
- "@typescript-eslint/no-invalid-void-type": "warn",
340
- "@typescript-eslint/no-dynamic-delete": "warn",
341
- "@typescript-eslint/no-useless-constructor": "warn",
342
- "@typescript-eslint/prefer-for-of": "warn",
343
- "@typescript-eslint/no-duplicate-enum-values": "warn"
344
- };
345
-
346
- const tsConfig = [
347
- ...jsConfig,
348
- ...tseslint.configs.strict,
349
- ...tseslint.configs.stylistic,
350
- {
351
- name: "custom-ts",
352
- files: ["**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}"],
353
- rules: rules$3
354
- }
355
- ];
356
-
357
- const rules$2 = {
358
- ...rules$4,
359
- ...rules$3
360
- };
361
-
362
- const reactTsConfig = [
363
- ...reactConfig,
364
- ...tsConfig,
365
- {
366
- name: "custom-react-ts",
367
- rules: rules$2
368
- }
369
- ];
370
-
371
- const astroTsConfig = [
372
- ...reactTsConfig,
373
- ...astroConfig,
374
- ...compat.fixupConfigRules(flatCompat.config({
375
- overrides: [{
376
- files: ["*.astro"],
377
- parser: "astro-eslint-parser",
378
- plugins: ["@typescript-eslint"],
379
- rules: {
380
- "@typescript-eslint/strict-boolean-expressions": "off"
381
- }
382
- }]
383
- }))
384
- ];
385
-
386
- const rules$1 = {
387
- ...rules$4,
388
- "simple-import-sort/imports": [
389
- "warn",
390
- {
391
- groups: [
392
- // Packages `react` related packages come first.
393
- ["^react"],
394
- ["^next"],
395
- ...groups
396
- ]
397
- }
398
- ]
399
- };
400
-
401
- const nextConfig = [
402
- ...reactConfig,
403
- ...compat.fixupConfigRules(flatCompat.extends("plugin:@next/next/core-web-vitals")),
404
- {
405
- name: "custom-next",
406
- rules: rules$1
407
- }
408
- ];
409
-
410
- const rules = {
411
- ...rules$4,
412
- "simple-import-sort/imports": [
413
- "warn",
414
- {
415
- groups: [
416
- // Packages `react` related packages come first.
417
- ["^react"],
418
- ["^next"],
419
- ...groups
420
- ]
421
- }
422
- ]
423
- };
424
-
425
- const nextTsConfig = [
426
- ...nextConfig,
427
- ...reactTsConfig,
428
- {
429
- name: "custom-next-ts",
430
- rules
431
- }
432
- ];
433
-
434
- exports.astroEslint = astroConfig;
435
- exports.astroTsEslint = astroTsConfig;
436
- exports.jsEslint = jsConfig;
437
- exports.nextEslint = nextConfig;
438
- exports.nextTsEslint = nextTsConfig;
439
- exports.reactEslint = reactConfig;
440
- exports.reactTsEslint = reactTsConfig;
441
- exports.tsEslint = tsConfig;