@morgs32/eslint-config 2.0.12 → 3.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/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @zerospin/utils
2
+
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 509be53: Big overhaul
@@ -0,0 +1,65 @@
1
+ export { defineConfig } from '@jimmy.codes/eslint-config'
2
+
3
+ import type { Linter } from 'eslint'
4
+
5
+ import vitest from '@vitest/eslint-plugin'
6
+
7
+ export const baseConfig: Linter.Config = {
8
+ name: 'baseConfig',
9
+ files: ['**/*.ts', '**/*.tsx'],
10
+ plugins: {
11
+ vitest,
12
+ },
13
+ rules: {
14
+ 'default-case': 'off',
15
+ 'unicorn/consistent-function-scoping': 'off',
16
+ 'unicorn/prefer-top-level-await': 'off',
17
+ '@eslint-community/eslint-comments/disable-enable-pair': [
18
+ 'error',
19
+ { allowWholeFile: true },
20
+ ],
21
+ '@eslint-community/eslint-comments/require-description': 'off',
22
+ '@next/next/no-html-link-for-pages': 'off',
23
+ '@stylistic/padding-line-between-statements': ['off'],
24
+ '@typescript-eslint/no-dynamic-delete': 'off',
25
+ '@typescript-eslint/no-empty-function': 'off',
26
+ '@typescript-eslint/no-explicit-any': 'off',
27
+ '@typescript-eslint/no-unnecessary-type-parameters': 'off',
28
+ '@typescript-eslint/only-throw-error': [
29
+ 'error',
30
+ {
31
+ allow: ['ZerospinError'],
32
+ },
33
+ ],
34
+ '@typescript-eslint/require-await': 'off',
35
+ 'class-methods-use-this': 'off',
36
+ 'consistent-return': 'off',
37
+ 'jest/require-hook': 'off',
38
+ 'jsdoc/check-tag-names': 'off',
39
+ 'no-magic-numbers': 'off',
40
+ 'no-param-reassign': 'off',
41
+ 'no-prototype-builtins': 'off',
42
+ 'perfectionist/sort-interfaces': [
43
+ 'error',
44
+ {
45
+ groups: ['required-property', 'optional-property'],
46
+ },
47
+ ],
48
+ 'perfectionist/sort-object-types': [
49
+ 'error',
50
+ { groups: ['required-property', 'optional-property'] },
51
+ ],
52
+ 'react-compiler/react-compiler': 'off',
53
+ 'testing-library/await-async-queries': 'off',
54
+ 'unicorn/prefer-event-target': 'off',
55
+ 'unicorn/throw-new-error': 'off',
56
+ 'vitest/expect-expect': 'off',
57
+ 'vitest/no-standalone-expect': [
58
+ 'error',
59
+ {
60
+ additionalTestBlockFunctions: ['it.effect', 'it.effect.only'],
61
+ },
62
+ ],
63
+ 'vitest/require-hook': 'off',
64
+ },
65
+ }
package/package.json CHANGED
@@ -1,11 +1,23 @@
1
1
  {
2
2
  "name": "@morgs32/eslint-config",
3
- "version": "2.0.12",
3
+ "version": "3.0.0",
4
4
  "description": "",
5
- "main": ".eslintrc.js",
5
+ "type": "module",
6
+ "main": "./eslint.config.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./eslint.config.ts",
10
+ "import": "./eslint.config.ts",
11
+ "require": "./eslint.config.ts"
12
+ }
13
+ },
6
14
  "files": [
7
- "*.eslintrc.js"
15
+ "eslint.config.ts",
16
+ "CHANGELOG.md"
8
17
  ],
18
+ "scripts": {
19
+ "lint": "eslint ."
20
+ },
9
21
  "repository": {
10
22
  "type": "git",
11
23
  "url": "git+https://github.com/morgs32/eslint-config.git"
@@ -17,14 +29,12 @@
17
29
  },
18
30
  "homepage": "https://github.com/morgs32/eslint-config#readme",
19
31
  "dependencies": {
20
- "@typescript-eslint/eslint-plugin": "^6.2.0",
21
- "eslint-config-next": "^13.4.12",
22
- "eslint-config-prettier": "^8.10.0",
23
- "eslint-plugin-jest": "^27.2.3",
24
- "eslint-plugin-prettier": "^5.0.0",
25
- "eslint-plugin-react": "^7.33.1",
26
- "eslint-plugin-testing-library": "^5.11.0",
27
- "eslint-plugin-unused-imports": "^3.0.0"
32
+ "@jimmy.codes/eslint-config": "^6.28.0",
33
+ "@types/eslint-plugin-import": "github:import-js/eslint-plugin-import",
34
+ "@typescript-eslint/parser": "^8.34.1",
35
+ "@vitest/eslint-plugin": "^1.2.0",
36
+ "eslint": "latest",
37
+ "eslint-plugin-import": "^2.31.0"
28
38
  },
29
39
  "peerDependencies": {
30
40
  "eslint": "*",
@@ -32,15 +42,5 @@
32
42
  "prettier": "^3.0.3",
33
43
  "typescript": "*"
34
44
  },
35
- "devDependencies": {
36
- "@types/react": "^18.2.17",
37
- "eslint": "^8.46.0",
38
- "next": "^13.4.12",
39
- "prettier": "^3.0.3",
40
- "react": "^18.2.0",
41
- "typescript": "^5.1.6"
42
- },
43
- "scripts": {
44
- "lint": "eslint ."
45
- }
46
- }
45
+ "devDependencies": {}
46
+ }
package/.eslintrc.js DELETED
@@ -1,4 +0,0 @@
1
- // @ts-check
2
- module.exports = {
3
- extends: ["./base.eslintrc", "prettier"],
4
- }
package/base.eslintrc.js DELETED
@@ -1,336 +0,0 @@
1
- // @ts-check
2
- module.exports = {
3
- extends: ["next/core-web-vitals"],
4
- ignorePatterns: ["**/lib", "**/dist"],
5
- settings: {
6
- react: {
7
- version: "detect",
8
- },
9
- },
10
- plugins: [
11
- "import",
12
- "unused-imports",
13
- "react",
14
- "react-hooks",
15
- "jsx-a11y",
16
- "@typescript-eslint",
17
- "jest",
18
- "testing-library",
19
- "prettier",
20
- ],
21
- rules: {
22
- "prettier/prettier": "error",
23
- "spaced-comment": ["error", "always", { markers: ["/"] }],
24
- "unused-imports/no-unused-imports": "error",
25
- "comma-spacing": ["error", { before: false, after: true }],
26
- "react/jsx-indent": ["error", 2],
27
- "space-infix-ops": ["error"],
28
- quotes: ["error", "double"],
29
- "space-before-blocks": "error",
30
- "keyword-spacing": "error",
31
- "object-curly-spacing": ["error", "always"],
32
- "react/jsx-indent-props": [2, 2],
33
- "react/jsx-first-prop-new-line": [2, "multiline"],
34
-
35
- // https://github.com/facebook/create-react-app/blob/main/packages/eslint-config-react-app/index.js
36
- "array-callback-return": "warn",
37
- "default-case": ["warn", { commentPattern: "^no default$" }],
38
- "dot-location": ["warn", "property"],
39
- eqeqeq: ["warn", "smart"],
40
- "new-parens": "warn",
41
- "no-array-constructor": "warn",
42
- "no-caller": "warn",
43
- "no-cond-assign": ["warn", "except-parens"],
44
- "no-const-assign": "warn",
45
- "no-control-regex": "warn",
46
- "no-delete-var": "warn",
47
- "no-dupe-args": "warn",
48
- "no-dupe-class-members": "warn",
49
- "no-dupe-keys": "warn",
50
- "no-duplicate-case": "warn",
51
- "no-empty-character-class": "warn",
52
- "no-empty-pattern": "warn",
53
- "no-eval": "warn",
54
- "no-ex-assign": "warn",
55
- "no-extend-native": "warn",
56
- "no-extra-bind": "warn",
57
- "no-extra-label": "warn",
58
- "no-fallthrough": "warn",
59
- "no-func-assign": "warn",
60
- "no-implied-eval": "warn",
61
- "no-invalid-regexp": "warn",
62
- "no-iterator": "warn",
63
- "no-label-var": "warn",
64
- "no-labels": ["warn", { allowLoop: true, allowSwitch: false }],
65
- "no-lone-blocks": "warn",
66
- "no-loop-func": "warn",
67
- "no-mixed-operators": [
68
- "warn",
69
- {
70
- groups: [
71
- ["&", "|", "^", "~", "<<", ">>", ">>>"],
72
- ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
73
- ["&&", "||"],
74
- ["in", "instanceof"],
75
- ],
76
- allowSamePrecedence: false,
77
- },
78
- ],
79
- "no-multi-str": "warn",
80
- "no-global-assign": "warn",
81
- "no-unsafe-negation": "warn",
82
- "no-new-func": "warn",
83
- "no-new-object": "warn",
84
- "no-new-symbol": "warn",
85
- "no-new-wrappers": "warn",
86
- "no-obj-calls": "warn",
87
- "no-octal": "warn",
88
- "no-octal-escape": "warn",
89
- "no-redeclare": "warn",
90
- "no-regex-spaces": "warn",
91
- "no-restricted-syntax": ["warn", "WithStatement"],
92
- "no-script-url": "warn",
93
- "no-self-assign": "warn",
94
- "no-self-compare": "warn",
95
- "no-sequences": "warn",
96
- "no-shadow-restricted-names": "warn",
97
- "no-sparse-arrays": "warn",
98
- "no-template-curly-in-string": "warn",
99
- "no-this-before-super": "warn",
100
- "no-throw-literal": "warn",
101
- "no-undef": "error",
102
- // "no-restricted-globals": ["error"].concat(restrictedGlobals),
103
- "no-unreachable": "warn",
104
- "no-unused-expressions": [
105
- "error",
106
- {
107
- allowShortCircuit: true,
108
- allowTernary: true,
109
- allowTaggedTemplates: true,
110
- },
111
- ],
112
- "no-unused-labels": "warn",
113
- "no-unused-vars": [
114
- "warn",
115
- {
116
- args: "none",
117
- ignoreRestSiblings: true,
118
- },
119
- ],
120
- "no-use-before-define": [
121
- "warn",
122
- {
123
- functions: false,
124
- classes: false,
125
- variables: false,
126
- },
127
- ],
128
- "no-useless-computed-key": "warn",
129
- "no-useless-concat": "warn",
130
- "no-useless-constructor": "warn",
131
- "no-useless-escape": "warn",
132
- "no-useless-rename": [
133
- "warn",
134
- {
135
- ignoreDestructuring: false,
136
- ignoreImport: false,
137
- ignoreExport: false,
138
- },
139
- ],
140
- "no-with": "warn",
141
- "no-whitespace-before-property": "warn",
142
- "react-hooks/exhaustive-deps": "warn",
143
- "require-yield": "warn",
144
- "rest-spread-spacing": ["warn", "never"],
145
- strict: ["warn", "never"],
146
- "unicode-bom": ["warn", "never"],
147
- "use-isnan": "warn",
148
- "valid-typeof": "warn",
149
- "no-restricted-properties": [
150
- "error",
151
- {
152
- object: "require",
153
- property: "ensure",
154
- message:
155
- "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting",
156
- },
157
- {
158
- object: "System",
159
- property: "import",
160
- message:
161
- "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting",
162
- },
163
- ],
164
- "getter-return": "warn",
165
-
166
- // https://github.com/benmosher/eslint-plugin-import/tree/master/docs/rules
167
- "import/first": "error",
168
- "import/no-amd": "error",
169
- "import/no-anonymous-default-export": "warn",
170
- "import/no-webpack-loader-syntax": "error",
171
-
172
- // https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
173
- "react/forbid-foreign-prop-types": ["warn", { allowInPropTypes: true }],
174
- "react/jsx-no-comment-textnodes": "warn",
175
- "react/jsx-no-duplicate-props": "warn",
176
- "react/jsx-no-target-blank": "warn",
177
- "react/jsx-no-undef": "error",
178
- "react/jsx-pascal-case": [
179
- "warn",
180
- {
181
- allowAllCaps: true,
182
- ignore: [],
183
- },
184
- ],
185
- "react/no-danger-with-children": "warn",
186
- // Disabled because of undesirable warnings
187
- // See https://github.com/facebook/create-react-app/issues/5204 for
188
- // blockers until its re-enabled
189
- // 'react/no-deprecated': 'warn',
190
- "react/no-direct-mutation-state": "warn",
191
- "react/no-is-mounted": "warn",
192
- "react/no-typos": "error",
193
- "react/require-render-return": "error",
194
- "react/style-prop-object": "warn",
195
-
196
- // https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
197
- "jsx-a11y/alt-text": "warn",
198
- "jsx-a11y/anchor-has-content": "warn",
199
- "jsx-a11y/anchor-is-valid": [
200
- "warn",
201
- {
202
- aspects: ["noHref", "invalidHref"],
203
- },
204
- ],
205
- "jsx-a11y/aria-activedescendant-has-tabindex": "warn",
206
- "jsx-a11y/aria-props": "warn",
207
- "jsx-a11y/aria-proptypes": "warn",
208
- "jsx-a11y/aria-role": ["warn", { ignoreNonDOM: true }],
209
- "jsx-a11y/aria-unsupported-elements": "warn",
210
- "jsx-a11y/heading-has-content": "warn",
211
- "jsx-a11y/iframe-has-title": "warn",
212
- "jsx-a11y/img-redundant-alt": "warn",
213
- "jsx-a11y/no-access-key": "warn",
214
- "jsx-a11y/no-distracting-elements": "warn",
215
- "jsx-a11y/no-redundant-roles": "warn",
216
- "jsx-a11y/role-has-required-aria-props": "warn",
217
- "jsx-a11y/role-supports-aria-props": "warn",
218
- "jsx-a11y/scope": "warn",
219
-
220
- // https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks
221
- "react-hooks/rules-of-hooks": "error",
222
- },
223
- overrides: [
224
- {
225
- files: ["**/*.stories.*"],
226
- rules: {
227
- "import/no-anonymous-default-export": "off",
228
- },
229
- },
230
-
231
- // https://github.com/facebook/create-react-app/blob/main/packages/eslint-config-react-app/jest.js
232
- {
233
- files: ["**/__tests__/**/*", "**/*.{spec,test}.*"],
234
- env: {
235
- "jest/globals": true,
236
- },
237
- // A subset of the recommended rules:
238
- rules: {
239
- // https://github.com/jest-community/eslint-plugin-jest
240
- "jest/no-conditional-expect": "error",
241
- "jest/no-identical-title": "error",
242
- "jest/no-interpolation-in-snapshots": "error",
243
- "jest/no-jasmine-globals": "error",
244
- "jest/no-mocks-import": "error",
245
- "jest/valid-describe-callback": "error",
246
- "jest/valid-expect": "error",
247
- "jest/valid-expect-in-promise": "error",
248
- "jest/valid-title": "warn",
249
-
250
- // https://github.com/testing-library/eslint-plugin-testing-library
251
- "testing-library/await-async-query": "error",
252
- "testing-library/await-async-utils": "error",
253
- "testing-library/no-await-sync-query": "error",
254
- "testing-library/no-container": "error",
255
- "testing-library/no-debugging-utils": "error",
256
- "testing-library/no-dom-import": ["error", "react"],
257
- "testing-library/no-node-access": "error",
258
- "testing-library/no-promise-in-fire-event": "error",
259
- "testing-library/no-render-in-setup": "error",
260
- "testing-library/no-unnecessary-act": "error",
261
- "testing-library/no-wait-for-empty-callback": "error",
262
- "testing-library/no-wait-for-multiple-assertions": "error",
263
- "testing-library/no-wait-for-side-effects": "error",
264
- "testing-library/no-wait-for-snapshot": "error",
265
- "testing-library/prefer-find-by": "error",
266
- "testing-library/prefer-presence-queries": "error",
267
- "testing-library/prefer-query-by-disappearance": "error",
268
- "testing-library/prefer-screen-queries": "error",
269
- "testing-library/render-result-naming-convention": "error",
270
- },
271
- },
272
-
273
- // https://github.com/facebook/create-react-app/blob/main/packages/eslint-config-react-app/index.js
274
- {
275
- files: ["**/*.ts?(x)"],
276
- // parser: "@typescript-eslint/parser",
277
- // parserOptions: {
278
- // ecmaVersion: 2018,
279
- // sourceType: "module",
280
- // ecmaFeatures: {
281
- // jsx: true,
282
- // },
283
-
284
- // // typescript-eslint specific options
285
- // warnOnUnsupportedTypeScriptVersion: true,
286
- // },
287
- // plugins: ["@typescript-eslint"],
288
- // If adding a typescript-eslint version of an existing ESLint rule,
289
- // make sure to disable the ESLint rule here.
290
- rules: {
291
- // TypeScript's `noFallthroughCasesInSwitch` option is more robust (#6906)
292
- "default-case": "off",
293
- // 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/291)
294
- "no-dupe-class-members": "off",
295
- // 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/477)
296
- "no-undef": "off",
297
-
298
- // Add TypeScript specific rules (and turn off ESLint equivalents)
299
- "@typescript-eslint/consistent-type-assertions": "warn",
300
- "no-array-constructor": "off",
301
- "@typescript-eslint/no-array-constructor": "warn",
302
- "no-redeclare": "off",
303
- "@typescript-eslint/no-redeclare": "warn",
304
- "no-use-before-define": "off",
305
- "@typescript-eslint/no-use-before-define": [
306
- "warn",
307
- {
308
- functions: false,
309
- classes: false,
310
- variables: false,
311
- typedefs: false,
312
- },
313
- ],
314
- "no-unused-expressions": "off",
315
- "@typescript-eslint/no-unused-expressions": [
316
- "error",
317
- {
318
- allowShortCircuit: true,
319
- allowTernary: true,
320
- allowTaggedTemplates: true,
321
- },
322
- ],
323
- "no-unused-vars": "off",
324
- "@typescript-eslint/no-unused-vars": [
325
- "warn",
326
- {
327
- args: "none",
328
- ignoreRestSiblings: true,
329
- },
330
- ],
331
- "no-useless-constructor": "off",
332
- "@typescript-eslint/no-useless-constructor": "warn",
333
- },
334
- },
335
- ],
336
- }