@tuomashatakka/eslint-config 2.2.1 → 2.2.2
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/index.mjs +18 -1
- package/package.json +1 -1
- package/rules.mjs +12 -3
package/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import globals from 'globals'
|
|
1
2
|
import tseslint from 'typescript-eslint'
|
|
2
3
|
|
|
3
4
|
import config from './eslint.config.mjs'
|
|
@@ -9,7 +10,23 @@ const configType = tseslint.configs.base
|
|
|
9
10
|
* @name config
|
|
10
11
|
* @type {typeof configType}
|
|
11
12
|
*/
|
|
12
|
-
export default
|
|
13
|
+
export default [
|
|
14
|
+
...config,
|
|
15
|
+
{
|
|
16
|
+
files: [ '**/*.{js,jsx,mjs,cjs,ts,tsx}' ],
|
|
17
|
+
languageOptions: {
|
|
18
|
+
ecmaVersion: 'latest',
|
|
19
|
+
sourceType: 'module',
|
|
20
|
+
parserOptions: {
|
|
21
|
+
ecmaFeatures: {
|
|
22
|
+
jsx: true,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
globals: {
|
|
26
|
+
...globals.browser,
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
}]
|
|
13
30
|
|
|
14
31
|
export {
|
|
15
32
|
config,
|
package/package.json
CHANGED
package/rules.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @exports {import("eslint/rules").ESLintRules} rules
|
|
3
3
|
* @type {import("@eslint/core").RulesConfig}
|
|
4
4
|
*/
|
|
5
|
+
|
|
5
6
|
export const rules = {
|
|
6
7
|
|
|
7
8
|
// '@next/next/no-styled-jsx-in-document': [ 'error' ],
|
|
@@ -37,9 +38,7 @@ export const rules = {
|
|
|
37
38
|
],
|
|
38
39
|
|
|
39
40
|
// Typescript
|
|
40
|
-
'@
|
|
41
|
-
'@typescript-eslint/no-unused-vars': [ 'warn' ],
|
|
42
|
-
'@typescript-eslint/no-explicit-any': [ 'warn' ],
|
|
41
|
+
'@stylistic/ban-ts-comment': [ 'off', 'allow-single-line' ],
|
|
43
42
|
|
|
44
43
|
// Enforced practices (enforce functional and orthogonal code)
|
|
45
44
|
'complexity': [ 'warn', { max: 11 }],
|
|
@@ -182,6 +181,16 @@ export const rules = {
|
|
|
182
181
|
{ blankLine: 'any',
|
|
183
182
|
prev: [ 'multiline-expression', 'function', 'block-like', 'block' ],
|
|
184
183
|
next: [ 'multiline-expression', 'function', 'block-like', 'block' ]}],
|
|
184
|
+
|
|
185
|
+
'@stylistic/jsx-closing-bracket-location': [ 0 ],
|
|
186
|
+
'@stylistic/jsx-one-expression-per-line': [ 'warn', { allow: 'non-jsx' }],
|
|
187
|
+
'react/jsx-one-expression-per-line': [ 'warn', { allow: 'non-jsx' }],
|
|
188
|
+
'react/jsx-closing-bracket-location': [ 0 ],
|
|
189
|
+
'react/jsx-curly-spacing': [ 0 ],
|
|
190
|
+
'@stylistic/jsx-curly-spacing': [ 'warn', { spacing: { objectLiterals: 'always' }}],
|
|
191
|
+
'@stylistic/implicit-arrow-linebreak': [ 0 ],
|
|
192
|
+
'@stylistic/arrow-parens': [ 1, 'as-needed', { requireForBlockBody: true }],
|
|
193
|
+
'@stylistic/space-before-function-paren': [ 1, 'always' ]
|
|
185
194
|
}
|
|
186
195
|
|
|
187
196
|
export default rules
|