@dangee1705/eslint-config 0.2.1 → 0.3.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/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Dan Gee's ESLint Config
2
+
3
+ An ESLint Config for Javascript, Typescript and React
package/eslint.config.js CHANGED
@@ -3,6 +3,7 @@ import typescriptEslint from '@typescript-eslint/eslint-plugin';
3
3
  import parser from '@typescript-eslint/parser';
4
4
  import reactHooks from 'eslint-plugin-react-hooks';
5
5
  import simpleImportSort from 'eslint-plugin-simple-import-sort';
6
+ import globals from 'globals';
6
7
 
7
8
  /** @type {import('eslint').Linter.Config[]} */
8
9
  export default [
@@ -14,6 +15,10 @@ export default [
14
15
  {
15
16
  files: ['**/*.{js,jsx,ts,tsx}'],
16
17
  languageOptions: {
18
+ globals: {
19
+ ...globals.browser,
20
+ ...globals.node
21
+ },
17
22
  parser,
18
23
  parserOptions: {
19
24
  allowJS: true,
@@ -90,12 +95,12 @@ export default [
90
95
  'capitalized-comments': ['off'],
91
96
  'class-methods-use-this': ['warn'],
92
97
  'complexity': ['off'],
93
- 'consistent-return': ['warn'],
98
+ 'consistent-return': ['off'],
94
99
  'consistent-this': ['warn'],
95
100
  'curly': ['warn', 'multi', 'consistent'],
96
101
  'default-case': ['off'],
97
102
  'default-case-last': ['off'],
98
- 'default-param-last': ['warn'],
103
+ 'default-param-last': ['off'],
99
104
  'dot-notation': ['off'],
100
105
  'eqeqeq': ['warn'],
101
106
  'func-name-matching': ['warn'],
@@ -110,11 +115,11 @@ export default [
110
115
  'logical-assignment-operators': ['warn'],
111
116
  'max-classes-per-file': ['off'],
112
117
  'max-depth': ['warn', {'max': 4}],
113
- 'max-lines': ['warn', {'max': 500}],
114
- 'max-lines-per-function': ['warn', {'max': 50}],
118
+ 'max-lines': ['off'],
119
+ 'max-lines-per-function': ['off'],
115
120
  'max-nested-callbacks': ['warn', {'max': 3}],
116
121
  'max-params': ['warn', {'max': 5}],
117
- 'max-statements': ['warn', {'max': 10}],
122
+ 'max-statements': ['off'],
118
123
  'new-cap': ['warn'],
119
124
  'no-alert': ['off'],
120
125
  'no-array-constructor': ['warn'],
@@ -177,7 +182,7 @@ export default [
177
182
  'no-ternary': ['off'],
178
183
  'no-throw-literal': ['warn'],
179
184
  'no-undef-init': ['warn'],
180
- 'no-undefined': ['warn'],
185
+ 'no-undefined': ['off'],
181
186
  'no-underscore-dangle': ['warn'],
182
187
  'no-unneeded-ternary': ['warn'],
183
188
  'no-unused-expressions': ['warn'],
@@ -212,7 +217,7 @@ export default [
212
217
  'prefer-template': ['warn'],
213
218
  'radix': ['warn'],
214
219
  'require-await': ['warn'],
215
- 'require-unicode-regexp': ['warn'],
220
+ 'require-unicode-regexp': ['off'],
216
221
  'require-yield': ['warn'],
217
222
  'sort-imports': ['off'],
218
223
  'sort-keys': ['off'],
@@ -226,9 +231,9 @@ export default [
226
231
  'react-hooks/rules-of-hooks': 'error',
227
232
  'react-hooks/exhaustive-deps': 'error',
228
233
 
229
- '@stylistic/array-bracket-newline': ['warn', {'multiline': true}],
234
+ '@stylistic/array-bracket-newline': ['warn', 'consistent'],
230
235
  '@stylistic/array-bracket-spacing': ['warn', 'never'],
231
- '@stylistic/array-element-newline': ['warn', 'consistent'],
236
+ '@stylistic/array-element-newline': ['warn', {'consistent': true, 'multiline': true}],
232
237
  '@stylistic/arrow-parens': ['warn', 'as-needed'],
233
238
  '@stylistic/arrow-spacing': ['warn'],
234
239
  '@stylistic/block-spacing': ['warn', 'never'],
@@ -291,7 +296,7 @@ export default [
291
296
  '@stylistic/multiline-comment-style': ['off'],
292
297
  '@stylistic/multiline-ternary': ['warn', 'always-multiline'],
293
298
  '@stylistic/new-parens': ['warn', 'always'],
294
- '@stylistic/newline-per-chained-call': ['warn', {'ignoreChainWithDepth': 2}],
299
+ '@stylistic/newline-per-chained-call': ['warn', {'ignoreChainWithDepth': 3}],
295
300
  '@stylistic/no-confusing-arrow': ['warn', {'allowParens': true}],
296
301
  '@stylistic/no-extra-parens': ['warn', 'all', {'nestedBinaryExpressions': false, 'ignoreJSX': 'multi-line', 'enforceForArrowConditionals': false}],
297
302
  '@stylistic/no-extra-semi': ['warn'],
@@ -338,24 +343,24 @@ export default [
338
343
  '@stylistic/wrap-regex': ['off'],
339
344
  '@stylistic/yield-star-spacing': ['warn', 'before'],
340
345
 
341
- // '@typescript-eslint/adjacent-overload-signatures': ['warn'],
342
- // '@typescript-eslint/array-type': ['warn'],
343
- // '@typescript-eslint/await-thenable': ['warn'],
344
- // '@typescript-eslint/ban-ts-comment': ['warn'],
345
- // '@typescript-eslint/ban-tslint-comment': ['warn'],
346
- // '@typescript-eslint/class-literal-property-style': ['warn'],
347
- // '@typescript-eslint/class-methods-use-this': ['warn'],
348
- // '@typescript-eslint/consistent-generic-constructors': ['warn'],
349
- // '@typescript-eslint/consistent-indexed-object-style': ['warn'],
350
- // '@typescript-eslint/consistent-return': ['warn'],
351
- // '@typescript-eslint/consistent-type-assertions': ['warn'],
352
- // '@typescript-eslint/consistent-type-definitions': ['warn'],
353
- // '@typescript-eslint/consistent-type-exports': ['warn'],
354
- // '@typescript-eslint/consistent-type-imports': ['warn'],
355
- // '@typescript-eslint/default-param-last': ['warn'],
356
- // '@typescript-eslint/dot-notation': ['warn'],
357
- // '@typescript-eslint/explicit-function-return-type': ['warn'],
358
- // '@typescript-eslint/explicit-member-accessibility': ['warn'],
346
+ '@typescript-eslint/adjacent-overload-signatures': ['warn'],
347
+ '@typescript-eslint/array-type': ['warn', {'default': 'array'}],
348
+ '@typescript-eslint/await-thenable': ['warn'],
349
+ '@typescript-eslint/ban-ts-comment': ['off'],
350
+ '@typescript-eslint/ban-tslint-comment': ['error'],
351
+ '@typescript-eslint/class-literal-property-style': ['off'], // no preference afaik
352
+ '@typescript-eslint/class-methods-use-this': ['off'],
353
+ '@typescript-eslint/consistent-generic-constructors': ['warn', 'constructor'],
354
+ '@typescript-eslint/consistent-indexed-object-style': ['warn', 'index-signature'],
355
+ '@typescript-eslint/consistent-return': ['warn'],
356
+ '@typescript-eslint/consistent-type-assertions': ['warn', {'assertionStyle': 'as', 'objectLiteralTypeAssertions': 'allow'}],
357
+ '@typescript-eslint/consistent-type-definitions': ['warn', 'type'],
358
+ '@typescript-eslint/consistent-type-exports': ['off'],
359
+ '@typescript-eslint/consistent-type-imports': ['off'],
360
+ '@typescript-eslint/default-param-last': ['error'],
361
+ '@typescript-eslint/dot-notation': ['off'],
362
+ '@typescript-eslint/explicit-function-return-type': ['off'],
363
+ '@typescript-eslint/explicit-member-accessibility': ['off'],
359
364
  // '@typescript-eslint/explicit-module-boundary-types': ['warn'],
360
365
  // '@typescript-eslint/init-declarations': ['warn'],
361
366
  // '@typescript-eslint/max-params': ['warn'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dangee1705/eslint-config",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Dan Gee's ESLint Config",
5
5
  "keywords": [
6
6
  "eslint",
@@ -24,7 +24,8 @@
24
24
  "@typescript-eslint/parser": "^8.29.0",
25
25
  "eslint-plugin-react": "^7.37.4",
26
26
  "eslint-plugin-react-hooks": "^5.2.0",
27
- "eslint-plugin-simple-import-sort": "^12.1.1"
27
+ "eslint-plugin-simple-import-sort": "^12.1.1",
28
+ "globals": "^16.0.0"
28
29
  },
29
30
  "peerDependencies": {
30
31
  "eslint": "^9.23.0"