@switz/eslint-config 11.0.1 → 12.0.1
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/eslint.config.mjs +33 -0
- package/examples/example.mdx +1 -1
- package/mdx.mjs +33 -0
- package/package.json +8 -10
- package/prettier.config.js +8 -0
- package/react.mjs +14 -0
- package/tailwind.mjs +4 -0
- package/typescript.mjs +19 -0
- package/.eslintrc.cjs +0 -3
- package/eslintrc.cjs +0 -66
- package/mdx.cjs +0 -18
- package/node.cjs +0 -9
- package/react.cjs +0 -16
- package/tailwind.cjs +0 -8
- package/typescript.cjs +0 -31
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import prettierPlugin from 'eslint-plugin-prettier/recommended';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
js.configs.recommended,
|
|
6
|
+
{
|
|
7
|
+
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
|
8
|
+
rules: {
|
|
9
|
+
'max-len': [
|
|
10
|
+
'error',
|
|
11
|
+
{
|
|
12
|
+
code: 100,
|
|
13
|
+
ignoreComments: true,
|
|
14
|
+
ignoreStrings: true,
|
|
15
|
+
ignoreTemplateLiterals: true,
|
|
16
|
+
ignoreRegExpLiterals: true,
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
'no-console': 'warn',
|
|
20
|
+
'no-var': ['error'],
|
|
21
|
+
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
|
|
22
|
+
'prefer-arrow-callback': ['error'],
|
|
23
|
+
'prefer-const': [
|
|
24
|
+
'error',
|
|
25
|
+
{
|
|
26
|
+
destructuring: 'all',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
'quotes': ['error', 'single', { avoidEscape: true }],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
prettierPlugin,
|
|
33
|
+
];
|
package/examples/example.mdx
CHANGED
package/mdx.mjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as mdx from 'eslint-plugin-mdx';
|
|
2
|
+
import main from './eslint.config.mjs';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
main,
|
|
6
|
+
{
|
|
7
|
+
files: ['**/*.mdx'],
|
|
8
|
+
...mdx.flat,
|
|
9
|
+
languageOptions: {
|
|
10
|
+
parserOptions: {
|
|
11
|
+
ecmaFeatures: {
|
|
12
|
+
jsx: true,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
// optional, if you want to lint code blocks at the same
|
|
17
|
+
processor: mdx.createRemarkProcessor({
|
|
18
|
+
lintCodeBlocks: true,
|
|
19
|
+
// optional, if you want to disable language mapper, set it to `false`
|
|
20
|
+
// if you want to override the default language mapper inside, you can provide your own
|
|
21
|
+
languageMapper: {},
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
// {
|
|
25
|
+
// ...mdx.flatCodeBlocks,
|
|
26
|
+
// rules: {
|
|
27
|
+
// ...mdx.flatCodeBlocks.rules,
|
|
28
|
+
// // if you want to override some rules for code blocks
|
|
29
|
+
// 'no-var': 'error',
|
|
30
|
+
// 'prefer-const': 'error',
|
|
31
|
+
// },
|
|
32
|
+
// },
|
|
33
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@switz/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "eslintrc.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -11,22 +11,20 @@
|
|
|
11
11
|
"author": "",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"eslint": ">=
|
|
14
|
+
"eslint": ">= 9"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@
|
|
18
|
-
"
|
|
19
|
-
"@typescript-eslint/parser": "^7.11.0",
|
|
20
|
-
"eslint-config-prettier": "^9.1.0",
|
|
17
|
+
"@eslint/js": "^9.24.0",
|
|
18
|
+
"eslint-config-prettier": "^10.1.1",
|
|
21
19
|
"eslint-plugin-mdx": "^3.1.5",
|
|
22
20
|
"eslint-plugin-prettier": "^5.1.3",
|
|
23
21
|
"eslint-plugin-react": "^7.34.2",
|
|
24
22
|
"eslint-plugin-tailwindcss": "^3.17.0",
|
|
25
|
-
"prettier": "3.
|
|
26
|
-
"prettier-plugin-tailwindcss": "^0.
|
|
23
|
+
"prettier": "3.5.3",
|
|
24
|
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
25
|
+
"typescript-eslint": "^8.29.0"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
|
-
"
|
|
30
|
-
"eslint": "^8.57.0"
|
|
28
|
+
"eslint": "^9.24.0"
|
|
31
29
|
}
|
|
32
30
|
}
|
package/react.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import main from './eslint.config.mjs';
|
|
2
|
+
import react from 'eslint-plugin-react';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
main,
|
|
6
|
+
react,
|
|
7
|
+
react.configs.flat.recommended,
|
|
8
|
+
react.configs.flat['jsx-runtime'],
|
|
9
|
+
{
|
|
10
|
+
rules: {
|
|
11
|
+
'react/display-name': 'off',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
];
|
package/tailwind.mjs
ADDED
package/typescript.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import main from './eslint.config.mjs';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
main,
|
|
6
|
+
tseslint.configs.recommended,
|
|
7
|
+
{
|
|
8
|
+
rules: {
|
|
9
|
+
'indent': 'off',
|
|
10
|
+
'no-unused-vars': 'off',
|
|
11
|
+
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
|
|
12
|
+
'@typescript-eslint/indent': 'off',
|
|
13
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
14
|
+
'@typescript-eslint/camelcase': 'off',
|
|
15
|
+
'@typescript-eslint/no-use-before-define': ['error', { variables: false }],
|
|
16
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
];
|
package/.eslintrc.cjs
DELETED
package/eslintrc.cjs
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['eslint:recommended'],
|
|
3
|
-
globals: {},
|
|
4
|
-
parser: '@babel/eslint-parser',
|
|
5
|
-
parserOptions: {
|
|
6
|
-
allowImportExportEverywhere: true,
|
|
7
|
-
ecmaVersion: 8,
|
|
8
|
-
sourceType: 'module',
|
|
9
|
-
requireConfigFile: false,
|
|
10
|
-
},
|
|
11
|
-
plugins: ['prettier'],
|
|
12
|
-
rules: {
|
|
13
|
-
'prettier/prettier': [
|
|
14
|
-
'error',
|
|
15
|
-
{
|
|
16
|
-
singleQuote: true,
|
|
17
|
-
trailingComma: 'es5',
|
|
18
|
-
printWidth: 100,
|
|
19
|
-
quoteProps: 'consistent',
|
|
20
|
-
endOfLine: 'auto',
|
|
21
|
-
plugins: ['prettier-plugin-tailwindcss'],
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
// 'comma-dangle': ['error', 'always-multiline'],
|
|
25
|
-
// 'comma-spacing': ['error'],
|
|
26
|
-
// 'eol-last': ['error', 'always'],
|
|
27
|
-
// 'indent': ['error', 2],
|
|
28
|
-
// 'key-spacing': ['error'],
|
|
29
|
-
// 'keyword-spacing': ['error'],
|
|
30
|
-
// 'linebreak-style': ['error', 'unix'],
|
|
31
|
-
'max-len': [
|
|
32
|
-
'error',
|
|
33
|
-
{
|
|
34
|
-
code: 100,
|
|
35
|
-
ignoreComments: true,
|
|
36
|
-
ignoreStrings: true,
|
|
37
|
-
ignoreTemplateLiterals: true,
|
|
38
|
-
ignoreRegExpLiterals: true,
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
'no-console': 'warn',
|
|
42
|
-
// 'no-multiple-empty-lines': [
|
|
43
|
-
// 'error',
|
|
44
|
-
// {
|
|
45
|
-
// max: 2,
|
|
46
|
-
// maxBOF: 0,
|
|
47
|
-
// maxEOF: 0,
|
|
48
|
-
// },
|
|
49
|
-
// ],
|
|
50
|
-
// 'no-trailing-spaces': ['error'],
|
|
51
|
-
'no-var': ['error'],
|
|
52
|
-
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
|
|
53
|
-
// 'object-curly-spacing': ['error', 'always'],
|
|
54
|
-
'prefer-arrow-callback': ['error'],
|
|
55
|
-
'prefer-const': [
|
|
56
|
-
'error',
|
|
57
|
-
{
|
|
58
|
-
destructuring: 'all',
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
// 'quote-props': ['error', 'consistent-as-needed'],
|
|
62
|
-
'quotes': ['error', 'single', { avoidEscape: true }],
|
|
63
|
-
// 'semi': ['error', 'always'],
|
|
64
|
-
// 'space-before-blocks': ['error'],
|
|
65
|
-
},
|
|
66
|
-
};
|
package/mdx.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
browser: true,
|
|
4
|
-
es6: true,
|
|
5
|
-
node: true,
|
|
6
|
-
},
|
|
7
|
-
extends: ['./eslintrc.cjs', 'plugin:react/recommended', 'plugin:mdx/recommended', 'prettier'],
|
|
8
|
-
rules: {
|
|
9
|
-
'react/display-name': 'off',
|
|
10
|
-
},
|
|
11
|
-
settings: {
|
|
12
|
-
'mdx/code-blocks': true,
|
|
13
|
-
"mdx/language-mapper": {},
|
|
14
|
-
'react': {
|
|
15
|
-
version: 'detect',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
};
|
package/node.cjs
DELETED
package/react.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
browser: true,
|
|
4
|
-
es6: true,
|
|
5
|
-
node: true,
|
|
6
|
-
},
|
|
7
|
-
extends: ['./eslintrc.cjs', 'plugin:react/recommended', 'plugin:react/jsx-runtime', 'prettier'],
|
|
8
|
-
rules: {
|
|
9
|
-
'react/display-name': 'off',
|
|
10
|
-
},
|
|
11
|
-
settings: {
|
|
12
|
-
react: {
|
|
13
|
-
version: 'detect',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
package/tailwind.cjs
DELETED
package/typescript.cjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
browser: true,
|
|
4
|
-
es6: true,
|
|
5
|
-
node: true,
|
|
6
|
-
},
|
|
7
|
-
extends: [
|
|
8
|
-
'plugin:@typescript-eslint/eslint-recommended',
|
|
9
|
-
'plugin:@typescript-eslint/recommended',
|
|
10
|
-
'prettier',
|
|
11
|
-
'./eslintrc.cjs',
|
|
12
|
-
],
|
|
13
|
-
rules: {
|
|
14
|
-
'indent': 'off',
|
|
15
|
-
'no-unused-vars': 'off',
|
|
16
|
-
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
|
|
17
|
-
'@typescript-eslint/indent': 'off',
|
|
18
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
19
|
-
'@typescript-eslint/camelcase': 'off',
|
|
20
|
-
'@typescript-eslint/no-use-before-define': ['error', { variables: false }],
|
|
21
|
-
'@typescript-eslint/no-empty-function': 'off',
|
|
22
|
-
},
|
|
23
|
-
parser: '@typescript-eslint/parser',
|
|
24
|
-
parserOptions: {
|
|
25
|
-
'ecmaFeatures.jsx': true,
|
|
26
|
-
},
|
|
27
|
-
plugins: ['@typescript-eslint'],
|
|
28
|
-
globals: {
|
|
29
|
-
JSX: 'readonly',
|
|
30
|
-
},
|
|
31
|
-
};
|