eslint-config-gits 5.0.4 → 5.0.6

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/CHANGELOG.md +14 -0
  2. package/index.mjs +126 -0
  3. package/package.json +2 -2
  4. package/index.js +0 -104
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [5.0.6](https://gitlab.com/geenen-it-systeme/eslint-preset/compare/v5.0.5...v5.0.6) (2024-08-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Migrate to correct eslint 9 flat config ([8135692](https://gitlab.com/geenen-it-systeme/eslint-preset/commit/8135692794d0ee4f0b6967e113ccde136e0646d8))
7
+
8
+ ## [5.0.5](https://gitlab.com/geenen-it-systeme/eslint-preset/compare/v5.0.4...v5.0.5) (2024-08-22)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Revert "fix: try index.js instead of index.mjs" ([c48663e](https://gitlab.com/geenen-it-systeme/eslint-preset/commit/c48663eaf821833ab8747bf35566391f529b504f))
14
+
1
15
  ## [5.0.4](https://gitlab.com/geenen-it-systeme/eslint-preset/compare/v5.0.3...v5.0.4) (2024-08-22)
2
16
 
3
17
 
package/index.mjs ADDED
@@ -0,0 +1,126 @@
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
+ import {name, version} from './package.json';
12
+
13
+ const __filename = fileURLToPath(import.meta.url);
14
+ const __dirname = path.dirname(__filename);
15
+ const compat = new FlatCompat({
16
+ baseDirectory: __dirname,
17
+ recommendedConfig: js.configs.recommended,
18
+ allConfig: js.configs.all
19
+ });
20
+
21
+ const configs = [
22
+ ...fixupConfigRules(compat.extends(
23
+ "eslint:recommended",
24
+ "plugin:react/recommended",
25
+ "plugin:@typescript-eslint/recommended",
26
+ "plugin:react-hooks/recommended",
27
+ )),
28
+ {
29
+ plugins: {
30
+ react: fixupPluginRules(react),
31
+ "@typescript-eslint": fixupPluginRules(typescriptEslint),
32
+ prettier,
33
+ "react-hooks": fixupPluginRules(reactHooks),
34
+ },
35
+ languageOptions: {
36
+ parser: tsParser,
37
+ ecmaVersion: "latest",
38
+ sourceType: "module",
39
+ parserOptions: {
40
+ ecmaFeatures: {
41
+ jsx: true,
42
+ },
43
+ },
44
+ },
45
+ },
46
+ {
47
+ files: ['*.ts', '*.tsx'],
48
+ rules: {
49
+ '@typescript-eslint/explicit-function-return-type': ['error'],
50
+ 'react/jsx-curly-brace-presence': ['error', {props: "never", children: "never"}],
51
+ 'arrow-body-style': ['error', 'as-needed']
52
+ },
53
+ },
54
+ {
55
+ files: ['*.json'],
56
+ rules: {
57
+ 'prettier/prettier': 'off',
58
+ },
59
+ },
60
+ {
61
+ files: ['**/*.stories.*'],
62
+ rules: {
63
+ 'import/no-anonymous-default-export': 'off',
64
+ },
65
+ },
66
+ {
67
+ files: ['*.test.ts', '*.test.tsx', '*.stories.*'],
68
+ rules: {
69
+ '@typescript-eslint/typedef': [
70
+ 'off'
71
+ ],
72
+ '@typescript-eslint/explicit-function-return-type': [
73
+ 'off'
74
+ ],
75
+ }
76
+ }
77
+ ]
78
+
79
+ const rules = {
80
+ 'no-undefined': 'error',
81
+ 'prettier/prettier': [
82
+ 'error',
83
+ {
84
+ tabWidth: 4,
85
+ useTabs: false,
86
+ printWidth: 80,
87
+ semi: true,
88
+ singleQuote: true,
89
+ quoteProps: 'as-needed',
90
+ jsxSingleQuote: false,
91
+ trailingComma: 'es5',
92
+ bracketSpacing: true,
93
+ bracketSameLine: false,
94
+ arrowParens: 'avoid',
95
+ },
96
+ ],
97
+ '@typescript-eslint/explicit-function-return-type': 'off',
98
+ '@typescript-eslint/no-inferrable-types': 'off',
99
+ '@typescript-eslint/typedef': [
100
+ 'error',
101
+ {
102
+ arrayDestructuring: false,
103
+ arrowParameter: false,
104
+ memberVariableDeclaration: true,
105
+ objectDestructuring: false,
106
+ parameter: false,
107
+ propertyDeclaration: true,
108
+ variableDeclaration: true,
109
+ variableDeclarationIgnoreFunction: false,
110
+ },
111
+ ],
112
+ '@typescript-eslint/no-unused-vars': 'error',
113
+ 'default-param-last': ['error']
114
+ };
115
+
116
+ const plugin = {
117
+ meta: {
118
+ name,
119
+ version
120
+ },
121
+ configs: {
122
+ recommended: configs
123
+ },
124
+ rules,
125
+ };
126
+ export default plugin;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "eslint-config-gits",
3
- "version": "5.0.4",
3
+ "version": "5.0.6",
4
4
  "description": "EsLint preset for Geenen IT-Systeme",
5
5
  "repository": "https://gitlab.com/geenen-it-systeme/eslint-preset",
6
- "main": "index.js",
6
+ "main": "index.mjs",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1"
9
9
  },
package/index.js DELETED
@@ -1,104 +0,0 @@
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
- ];