eslint-config-azuriru 2.0.0 → 2.1.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.
Files changed (4) hide show
  1. package/index.js +16 -1
  2. package/package.json +6 -1
  3. package/react.js +153 -0
  4. package/svelte.js +0 -1
package/index.js CHANGED
@@ -168,7 +168,11 @@ module.exports = {
168
168
  ],
169
169
  '@stylistic/lines-between-class-members': [
170
170
  'warn',
171
- 'always'
171
+ 'always',
172
+ {
173
+ exceptAfterOverload: false,
174
+ exceptAfterSingleLine: true
175
+ }
172
176
  ],
173
177
  '@stylistic/max-len': [
174
178
  'off'
@@ -430,6 +434,17 @@ module.exports = {
430
434
  caughtErrorsIgnorePattern: '^_'
431
435
  }
432
436
  ],
437
+
438
+ // Typing component return values is a chore
439
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
440
+
441
+ // I have enough self control to know when `any` is a good choice
442
+ '@typescript-eslint/no-explicit-any': 'off',
443
+
444
+ // Same thing here.
445
+ '@typescript-eslint/no-non-null-assertion': 'off',
446
+
447
+ // I want to use hasOwnProperty
433
448
  '@typescript-eslint/no-explicit-any': 'off'
434
449
  },
435
450
  ignorePatterns: [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-config-azuriru",
3
3
  "description": "My personal INCREDIBLY OPINIONATED configs for anything ESlint.",
4
- "version": "2.0.0",
4
+ "version": "2.1.0",
5
5
  "main": "index.js",
6
6
  "eslintConfig": {
7
7
  "env": {
@@ -14,6 +14,9 @@
14
14
  },
15
15
  "./svelte": {
16
16
  "default": "./svelte.js"
17
+ },
18
+ "./react": {
19
+ "default": "./react.js"
17
20
  }
18
21
  },
19
22
  "dependencies": {
@@ -22,6 +25,8 @@
22
25
  "@typescript-eslint/parser": "^6.18.1",
23
26
  "eslint": "^8.56.0",
24
27
  "eslint-plugin-antfu": "^2.2.0",
28
+ "eslint-plugin-react": "^7.34.1",
29
+ "eslint-plugin-react-hooks": "^4.6.2",
25
30
  "eslint-plugin-svelte": "^2.35.1",
26
31
  "eslint-plugin-svelte-stylistic": "^0.0.4",
27
32
  "svelte": "^4.2.5",
package/react.js ADDED
@@ -0,0 +1,153 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es2021: true,
5
+ node: true
6
+ },
7
+ settings: {
8
+ react: {
9
+ version: '17.0'
10
+ }
11
+ },
12
+ 'extends': [
13
+ 'plugin:react/recommended',
14
+ 'plugin:react-hooks/recommended'
15
+ ],
16
+ parser: '@typescript-eslint/parser',
17
+ parserOptions: {
18
+ ecmaFeatures: {
19
+ jsx: true
20
+ },
21
+ ecmaVersion: 12,
22
+ sourceType: 'module'
23
+ },
24
+ plugins: [
25
+ '@stylistic',
26
+ 'react'
27
+ ],
28
+ rules: {
29
+ '@stylistic/jsx-child-element-spacing': [
30
+ 'warn'
31
+ ],
32
+ '@stylistic/jsx-closing-bracket-location': [
33
+ 1,
34
+ {
35
+ nonEmpty: 'tag-aligned',
36
+ selfClosing: 'tag-aligned'
37
+ }
38
+ ],
39
+ '@stylistic/jsx-closing-tag-location': [
40
+ 'warn'
41
+ ],
42
+ '@stylistic/jsx-curly-brace-presence': [
43
+ 1,
44
+ {
45
+ props: 'never',
46
+ children: 'never',
47
+ propElementValues: 'always'
48
+ }
49
+ ],
50
+ '@stylistic/jsx-curly-newline': [
51
+ 'warn',
52
+ {
53
+ multiline: 'consistent',
54
+ singleline: 'consistent'
55
+ }
56
+ ],
57
+ '@stylistic/jsx-curly-spacing': [
58
+ 'warn',
59
+ {
60
+ when: 'never',
61
+ attributes: {
62
+ allowMultiline: false
63
+ },
64
+ children: true
65
+ }
66
+ ],
67
+ '@stylistic/jsx-equals-spacing': [
68
+ 'warn',
69
+ 'never'
70
+ ],
71
+ '@stylistic/jsx-first-prop-new-line': [
72
+ 'warn',
73
+ 'multiline'
74
+ ],
75
+ '@stylistic/jsx-function-call-newline': [
76
+ 'warn',
77
+ 'multiline'
78
+ ],
79
+
80
+ // I have regular stylistic indent on, but I might consider it if I find use for the fine grained options
81
+ '@stylistic/jsx-indent': 'off',
82
+ '@stylistic/jsx-indent-props': 'off',
83
+ '@stylistic/jsx-max-props-per-line': [
84
+ 1,
85
+ {
86
+ maximum: {
87
+ single: 4,
88
+ multi: 1
89
+ }
90
+ }
91
+ ],
92
+
93
+ // I would like to enforce grouping on my own
94
+ '@stylistic/jsx-newline': 'off',
95
+
96
+ // My brain small
97
+ '@stylistic/jsx-one-expression-per-line': 'off',
98
+ '@stylistic/jsx-pascal-case': [
99
+ 'warn',
100
+ {
101
+ allowNamespace: true,
102
+ allowLeadingUnderscore: true
103
+ }
104
+ ],
105
+ '@stylistic/jsx-props-no-multi-spaces': 'warn',
106
+ '@stylistic/jsx-self-closing-comp': [
107
+ 'warn',
108
+ {
109
+ component: true,
110
+ html: true
111
+ }
112
+ ],
113
+ '@stylistic/jsx-sort-props': [
114
+ 'warn',
115
+ {
116
+ callbacksLast: true,
117
+ shorthandLast: true,
118
+ noSortAlphabetically: true,
119
+ reservedFirst: true
120
+ }
121
+ ],
122
+ '@stylistic/jsx-tag-spacing': [
123
+ 'warn',
124
+ {
125
+ closingSlash: 'never',
126
+ beforeSelfClosing: 'always',
127
+ afterOpening: 'never',
128
+ beforeClosing: 'never'
129
+ }
130
+ ],
131
+ '@stylistic/jsx-wrap-multilines': [
132
+ 'warn',
133
+ {
134
+ 'return': 'parens-new-line'
135
+ }
136
+ ],
137
+ 'react/no-unknown-property': [
138
+ 'error',
139
+ {
140
+ ignore: [
141
+ 'class'
142
+ ]
143
+ }
144
+ ],
145
+
146
+ // I'm using the new JSX transform
147
+ 'react/jsx-uses-react': 'off',
148
+ 'react/react-in-jsx-scope': 'off',
149
+
150
+ // I want to be able to use apostrophes in my text
151
+ 'react/no-unescaped-entities': 'off'
152
+ }
153
+ };
package/svelte.js CHANGED
@@ -4,7 +4,6 @@ module.exports = {
4
4
  es2021: true
5
5
  },
6
6
  'extends': [
7
- 'plugin:@typescript-eslint/recommended',
8
7
  'plugin:svelte/base'
9
8
  ],
10
9
  parser: '@typescript-eslint/parser',