eslint-config-gits 5.0.1 → 5.0.3
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/CHANGELOG.md +15 -0
- package/README.md +30 -1
- package/index.mjs +104 -0
- package/package.json +7 -4
- package/index.js +0 -86
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [5.0.3](https://gitlab.com/geenen-it-systeme/eslint-preset/compare/v5.0.2...v5.0.3) (2024-08-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Define correct package main script ([1df1599](https://gitlab.com/geenen-it-systeme/eslint-preset/commit/1df15995b8205824e04b0a3cc69693ebad76b602))
|
|
7
|
+
* eslint remove peer dependencies for eslint config ([a0fb2ac](https://gitlab.com/geenen-it-systeme/eslint-preset/commit/a0fb2ac62a02cfb0c7b338a766f5eda65c988504))
|
|
8
|
+
|
|
9
|
+
## [5.0.2](https://gitlab.com/geenen-it-systeme/eslint-preset/compare/v5.0.1...v5.0.2) (2024-08-22)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* Migrate to eslint 9 config schema ([f1a4847](https://gitlab.com/geenen-it-systeme/eslint-preset/commit/f1a4847120a47691c2606d8d1e1d250290a7b87c))
|
|
15
|
+
|
|
1
16
|
## [5.0.1](https://gitlab.com/geenen-it-systeme/eslint-preset/compare/v5.0.0...v5.0.1) (2024-08-22)
|
|
2
17
|
|
|
3
18
|
|
package/README.md
CHANGED
|
@@ -8,5 +8,34 @@ This ESLint-Config provides commonly used configuration for eslint for all our p
|
|
|
8
8
|
## Installation
|
|
9
9
|
|
|
10
10
|
```shell
|
|
11
|
-
npm install --save-dev eslint eslint-config-gits
|
|
11
|
+
npm install --save-dev eslint eslint-config-gits globals @eslint/js @eslint/eslintr
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Example configuration
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
// eslint.config.mjs
|
|
18
|
+
import globals from "globals";
|
|
19
|
+
import path from "node:path";
|
|
20
|
+
import {fileURLToPath} from "node:url";
|
|
21
|
+
import js from "@eslint/js";
|
|
22
|
+
import {FlatCompat} from "@eslint/eslintrc";
|
|
23
|
+
|
|
24
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
25
|
+
const __dirname = path.dirname(__filename);
|
|
26
|
+
const compat = new FlatCompat({
|
|
27
|
+
baseDirectory: __dirname,
|
|
28
|
+
recommendedConfig: js.configs.recommended,
|
|
29
|
+
allConfig: js.configs.all
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export default [...compat.extends("eslint-config-gits"), {
|
|
33
|
+
languageOptions: {
|
|
34
|
+
globals: {
|
|
35
|
+
...globals.browser,
|
|
36
|
+
...globals.jest,
|
|
37
|
+
...globals.node,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
}];
|
|
12
41
|
```
|
package/index.mjs
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {fixupConfigRules, fixupPluginRules} from "@eslint/compat";
|
|
2
|
+
import react from "eslint-plugin-react";
|
|
3
|
+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
|
4
|
+
import prettier from "eslint-plugin-prettier";
|
|
5
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
6
|
+
import tsParser from "@typescript-eslint/parser";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import {fileURLToPath} from "node:url";
|
|
9
|
+
import js from "@eslint/js";
|
|
10
|
+
import {FlatCompat} from "@eslint/eslintrc";
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
const compat = new FlatCompat({
|
|
15
|
+
baseDirectory: __dirname,
|
|
16
|
+
recommendedConfig: js.configs.recommended,
|
|
17
|
+
allConfig: js.configs.all
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default [
|
|
21
|
+
...fixupConfigRules(compat.extends(
|
|
22
|
+
"eslint:recommended",
|
|
23
|
+
"plugin:react/recommended",
|
|
24
|
+
"plugin:@typescript-eslint/recommended",
|
|
25
|
+
"plugin:react-hooks/recommended",
|
|
26
|
+
)),
|
|
27
|
+
{
|
|
28
|
+
plugins: {
|
|
29
|
+
react: fixupPluginRules(react),
|
|
30
|
+
"@typescript-eslint": fixupPluginRules(typescriptEslint),
|
|
31
|
+
prettier,
|
|
32
|
+
"react-hooks": fixupPluginRules(reactHooks),
|
|
33
|
+
},
|
|
34
|
+
languageOptions: {
|
|
35
|
+
parser: tsParser,
|
|
36
|
+
ecmaVersion: "latest",
|
|
37
|
+
sourceType: "module",
|
|
38
|
+
parserOptions: {
|
|
39
|
+
ecmaFeatures: {
|
|
40
|
+
jsx: true,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
rules: {
|
|
45
|
+
"no-undefined": "error",
|
|
46
|
+
"prettier/prettier": ["error", {
|
|
47
|
+
tabWidth: 4,
|
|
48
|
+
useTabs: false,
|
|
49
|
+
printWidth: 80,
|
|
50
|
+
semi: true,
|
|
51
|
+
singleQuote: true,
|
|
52
|
+
quoteProps: "as-needed",
|
|
53
|
+
jsxSingleQuote: false,
|
|
54
|
+
trailingComma: "es5",
|
|
55
|
+
bracketSpacing: true,
|
|
56
|
+
bracketSameLine: false,
|
|
57
|
+
arrowParens: "avoid",
|
|
58
|
+
}],
|
|
59
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
60
|
+
"@typescript-eslint/no-inferrable-types": "off",
|
|
61
|
+
"@typescript-eslint/typedef": ["error", {
|
|
62
|
+
arrayDestructuring: false,
|
|
63
|
+
arrowParameter: false,
|
|
64
|
+
memberVariableDeclaration: true,
|
|
65
|
+
objectDestructuring: false,
|
|
66
|
+
parameter: false,
|
|
67
|
+
propertyDeclaration: true,
|
|
68
|
+
variableDeclaration: true,
|
|
69
|
+
variableDeclarationIgnoreFunction: false,
|
|
70
|
+
}],
|
|
71
|
+
"@typescript-eslint/no-unused-vars": "error",
|
|
72
|
+
"default-param-last": ["error"],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
77
|
+
rules: {
|
|
78
|
+
"@typescript-eslint/explicit-function-return-type": ["error"],
|
|
79
|
+
"react/jsx-curly-brace-presence": ["error", {
|
|
80
|
+
props: "never",
|
|
81
|
+
children: "never",
|
|
82
|
+
}],
|
|
83
|
+
"arrow-body-style": ["error", "as-needed"],
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
files: ["**/*.json"],
|
|
88
|
+
rules: {
|
|
89
|
+
"prettier/prettier": "off",
|
|
90
|
+
},
|
|
91
|
+
}, {
|
|
92
|
+
files: ["**/*.stories.*"],
|
|
93
|
+
rules: {
|
|
94
|
+
"import/no-anonymous-default-export": "off",
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
files: ["**/*.test.ts", "**/*.test.tsx", "**/*.stories.*"],
|
|
99
|
+
rules: {
|
|
100
|
+
"@typescript-eslint/typedef": ["off"],
|
|
101
|
+
"@typescript-eslint/explicit-function-return-type": ["off"],
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
];
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-gits",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"description": "EsLint preset for Geenen IT-Systeme",
|
|
5
5
|
"repository": "https://gitlab.com/geenen-it-systeme/eslint-preset",
|
|
6
|
-
"main": "index.
|
|
6
|
+
"main": "index.mjs",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
9
|
},
|
|
@@ -14,15 +14,18 @@
|
|
|
14
14
|
"author": "",
|
|
15
15
|
"license": "ISC",
|
|
16
16
|
"peerDependencies": {
|
|
17
|
+
"@typescript-eslint/eslint-plugin": "^8",
|
|
17
18
|
"eslint": "^9",
|
|
18
19
|
"eslint-plugin-prettier": "^5",
|
|
19
20
|
"eslint-plugin-react": "^7",
|
|
20
21
|
"eslint-plugin-react-hooks": "^5.1.0-rc-1d989965-20240821",
|
|
21
22
|
"eslint-plugin-storybook": "^0",
|
|
22
|
-
"prettier": "^3"
|
|
23
|
-
"@typescript-eslint/eslint-plugin": "^8"
|
|
23
|
+
"prettier": "^3"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
+
"@eslint/compat": "^1.1.1",
|
|
27
|
+
"@eslint/eslintrc": "^3.1.0",
|
|
28
|
+
"@eslint/js": "^9.9.0",
|
|
26
29
|
"@semantic-release/changelog": "^6.0.3",
|
|
27
30
|
"@semantic-release/git": "^10.0.1",
|
|
28
31
|
"@semantic-release/gitlab": "^13.2.1",
|
package/index.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
plugins: ['react', '@typescript-eslint', 'prettier', 'react-hooks'],
|
|
3
|
-
extends: [
|
|
4
|
-
'eslint:recommended',
|
|
5
|
-
'plugin:react/recommended',
|
|
6
|
-
'plugin:@typescript-eslint/recommended',
|
|
7
|
-
'plugin:react-hooks/recommended',
|
|
8
|
-
],
|
|
9
|
-
parser: '@typescript-eslint/parser',
|
|
10
|
-
parserOptions: {
|
|
11
|
-
ecmaFeatures: {
|
|
12
|
-
jsx: true,
|
|
13
|
-
},
|
|
14
|
-
ecmaVersion: 'latest',
|
|
15
|
-
sourceType: 'module',
|
|
16
|
-
},
|
|
17
|
-
rules: {
|
|
18
|
-
'no-undefined': 'error',
|
|
19
|
-
'prettier/prettier': [
|
|
20
|
-
'error',
|
|
21
|
-
{
|
|
22
|
-
tabWidth: 4,
|
|
23
|
-
useTabs: false,
|
|
24
|
-
printWidth: 80,
|
|
25
|
-
semi: true,
|
|
26
|
-
singleQuote: true,
|
|
27
|
-
quoteProps: 'as-needed',
|
|
28
|
-
jsxSingleQuote: false,
|
|
29
|
-
trailingComma: 'es5',
|
|
30
|
-
bracketSpacing: true,
|
|
31
|
-
bracketSameLine: false,
|
|
32
|
-
arrowParens: 'avoid',
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
36
|
-
'@typescript-eslint/no-inferrable-types': 'off',
|
|
37
|
-
'@typescript-eslint/typedef': [
|
|
38
|
-
'error',
|
|
39
|
-
{
|
|
40
|
-
arrayDestructuring: false,
|
|
41
|
-
arrowParameter: false,
|
|
42
|
-
memberVariableDeclaration: true,
|
|
43
|
-
objectDestructuring: false,
|
|
44
|
-
parameter: false,
|
|
45
|
-
propertyDeclaration: true,
|
|
46
|
-
variableDeclaration: true,
|
|
47
|
-
variableDeclarationIgnoreFunction: false,
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
'@typescript-eslint/no-unused-vars': 'error',
|
|
51
|
-
'default-param-last': ['error']
|
|
52
|
-
},
|
|
53
|
-
overrides: [
|
|
54
|
-
{
|
|
55
|
-
files: ['*.ts', '*.tsx'],
|
|
56
|
-
rules: {
|
|
57
|
-
'@typescript-eslint/explicit-function-return-type': ['error'],
|
|
58
|
-
'react/jsx-curly-brace-presence': ['error', {props: "never", children: "never"}],
|
|
59
|
-
'arrow-body-style': ['error', 'as-needed']
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
files: ['*.json'],
|
|
64
|
-
rules: {
|
|
65
|
-
'prettier/prettier': 'off',
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
files: ['**/*.stories.*'],
|
|
70
|
-
rules: {
|
|
71
|
-
'import/no-anonymous-default-export': 'off',
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
files: ['*.test.ts', '*.test.tsx', '*.stories.*'],
|
|
76
|
-
rules: {
|
|
77
|
-
'@typescript-eslint/typedef': [
|
|
78
|
-
'off'
|
|
79
|
-
],
|
|
80
|
-
'@typescript-eslint/explicit-function-return-type': [
|
|
81
|
-
'off'
|
|
82
|
-
],
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
],
|
|
86
|
-
};
|