eslint-config-azuriru 2.0.1 → 2.2.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 (3) hide show
  1. package/index.js +16 -1
  2. package/package.json +6 -1
  3. package/react.js +157 -0
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.1",
4
+ "version": "2.2.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,157 @@
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-quotes': [
30
+ 'warn',
31
+ 'prefer-double'
32
+ ],
33
+ '@stylistic/jsx-child-element-spacing': [
34
+ 'warn'
35
+ ],
36
+ '@stylistic/jsx-closing-bracket-location': [
37
+ 1,
38
+ {
39
+ nonEmpty: 'tag-aligned',
40
+ selfClosing: 'tag-aligned'
41
+ }
42
+ ],
43
+ '@stylistic/jsx-closing-tag-location': [
44
+ 'warn'
45
+ ],
46
+ '@stylistic/jsx-curly-brace-presence': [
47
+ 1,
48
+ {
49
+ props: 'never',
50
+ children: 'never',
51
+ propElementValues: 'always'
52
+ }
53
+ ],
54
+ '@stylistic/jsx-curly-newline': [
55
+ 'warn',
56
+ {
57
+ multiline: 'consistent',
58
+ singleline: 'consistent'
59
+ }
60
+ ],
61
+ '@stylistic/jsx-curly-spacing': [
62
+ 'warn',
63
+ {
64
+ when: 'never',
65
+ attributes: {
66
+ allowMultiline: false
67
+ },
68
+ children: true
69
+ }
70
+ ],
71
+ '@stylistic/jsx-equals-spacing': [
72
+ 'warn',
73
+ 'never'
74
+ ],
75
+ '@stylistic/jsx-first-prop-new-line': [
76
+ 'warn',
77
+ 'multiline'
78
+ ],
79
+ '@stylistic/jsx-function-call-newline': [
80
+ 'warn',
81
+ 'multiline'
82
+ ],
83
+
84
+ // I have regular stylistic indent on, but I might consider it if I find use for the fine grained options
85
+ '@stylistic/jsx-indent': 'off',
86
+ '@stylistic/jsx-indent-props': 'off',
87
+ '@stylistic/jsx-max-props-per-line': [
88
+ 1,
89
+ {
90
+ maximum: {
91
+ single: 4,
92
+ multi: 1
93
+ }
94
+ }
95
+ ],
96
+
97
+ // I would like to enforce grouping on my own
98
+ '@stylistic/jsx-newline': 'off',
99
+
100
+ // My brain small
101
+ '@stylistic/jsx-one-expression-per-line': 'off',
102
+ '@stylistic/jsx-pascal-case': [
103
+ 'warn',
104
+ {
105
+ allowNamespace: true,
106
+ allowLeadingUnderscore: true
107
+ }
108
+ ],
109
+ '@stylistic/jsx-props-no-multi-spaces': 'warn',
110
+ '@stylistic/jsx-self-closing-comp': [
111
+ 'warn',
112
+ {
113
+ component: true,
114
+ html: true
115
+ }
116
+ ],
117
+ '@stylistic/jsx-sort-props': [
118
+ 'warn',
119
+ {
120
+ callbacksLast: true,
121
+ shorthandLast: true,
122
+ noSortAlphabetically: true,
123
+ reservedFirst: true
124
+ }
125
+ ],
126
+ '@stylistic/jsx-tag-spacing': [
127
+ 'warn',
128
+ {
129
+ closingSlash: 'never',
130
+ beforeSelfClosing: 'always',
131
+ afterOpening: 'never',
132
+ beforeClosing: 'never'
133
+ }
134
+ ],
135
+ '@stylistic/jsx-wrap-multilines': [
136
+ 'warn',
137
+ {
138
+ 'return': 'parens-new-line'
139
+ }
140
+ ],
141
+ 'react/no-unknown-property': [
142
+ 'error',
143
+ {
144
+ ignore: [
145
+ 'class'
146
+ ]
147
+ }
148
+ ],
149
+
150
+ // I'm using the new JSX transform
151
+ 'react/jsx-uses-react': 'off',
152
+ 'react/react-in-jsx-scope': 'off',
153
+
154
+ // I want to be able to use apostrophes in my text
155
+ 'react/no-unescaped-entities': 'off'
156
+ }
157
+ };