@innovixx/eslint-config 4.0.0-alpha.0 → 4.0.0-alpha.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/config/configs/graphql/index.mjs +62 -0
- package/demo/src/graphql/generated/schema.graphql +7 -0
- package/demo/src/graphql/query/index.graphql +5 -0
- package/eslint.config.mjs +20 -4
- package/graphql.config.ts +11 -0
- package/package.json +16 -12
- package/demo/index.ts +0 -1
- /package/demo/{components → src/components}/ComponentTest/index.tsx +0 -0
- /package/demo/{components → src/components}/ComponentTestWithProps/index.tsx +0 -0
- /package/demo/{components → src/components}/index.ts +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import graphqlPlugin from '@graphql-eslint/eslint-plugin';
|
|
2
|
+
|
|
3
|
+
/** @type {import('eslint').Linter.Config[]} */
|
|
4
|
+
export const graphqlConfig = [
|
|
5
|
+
{
|
|
6
|
+
ignores: [
|
|
7
|
+
'**/schema.graphql',
|
|
8
|
+
'**/generated/**',
|
|
9
|
+
],
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
files: [
|
|
13
|
+
'src/endpoints/**/*.graphql',
|
|
14
|
+
'src/graphql/**/*.graphql',
|
|
15
|
+
],
|
|
16
|
+
|
|
17
|
+
languageOptions: {
|
|
18
|
+
parser: graphqlPlugin.parser,
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
plugins: {
|
|
22
|
+
'@graphql-eslint': graphqlPlugin,
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
rules: {
|
|
26
|
+
'eol-last': 'warn',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
files: ['src/endpoints/**/*.graphql'],
|
|
31
|
+
|
|
32
|
+
rules: {
|
|
33
|
+
...graphqlPlugin.configs['flat/schema-recommended'].rules,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
files: ['src/graphql/**/*.graphql'],
|
|
38
|
+
|
|
39
|
+
rules: {
|
|
40
|
+
...graphqlPlugin.configs['flat/operations-recommended'].rules,
|
|
41
|
+
'eol-last': 'warn',
|
|
42
|
+
'@graphql-eslint/no-anonymous-operations': 'warn',
|
|
43
|
+
'@graphql-eslint/known-type-names': 'error',
|
|
44
|
+
'@graphql-eslint/no-duplicate-fields': 'warn',
|
|
45
|
+
'@graphql-eslint/naming-convention': [
|
|
46
|
+
'warn',
|
|
47
|
+
{
|
|
48
|
+
OperationDefinition: {
|
|
49
|
+
style: 'PascalCase',
|
|
50
|
+
forbiddenPrefixes: ['Query', 'Mutation', 'Subscription', 'Get'],
|
|
51
|
+
forbiddenSuffixes: ['Query', 'Mutation', 'Subscription'],
|
|
52
|
+
},
|
|
53
|
+
ObjectTypeDefinition: {
|
|
54
|
+
style: 'PascalCase',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
export default graphqlConfig;
|
package/eslint.config.mjs
CHANGED
|
@@ -2,13 +2,29 @@ import baseConfig from './config/configs/base/index.mjs';
|
|
|
2
2
|
import reactConfig from './config/configs/react/index.mjs';
|
|
3
3
|
import typescriptConfig from './config/configs/typescript/index.mjs';
|
|
4
4
|
import jestConfig from './config/configs/jest/index.mjs';
|
|
5
|
+
import graphqlConfig from './config/configs/graphql/index.mjs';
|
|
5
6
|
|
|
6
7
|
export default [
|
|
7
|
-
baseConfig,
|
|
8
|
-
reactConfig,
|
|
9
|
-
typescriptConfig,
|
|
10
|
-
jestConfig,
|
|
11
8
|
{
|
|
9
|
+
...baseConfig,
|
|
12
10
|
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
13
11
|
},
|
|
12
|
+
{
|
|
13
|
+
...reactConfig,
|
|
14
|
+
files: ['**/*.{jsx,tsx}'],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
...typescriptConfig,
|
|
18
|
+
files: ['**/*.{ts,tsx}'],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
...jestConfig,
|
|
22
|
+
files: ['**/*.test.{js,jsx,ts,tsx}'],
|
|
23
|
+
},
|
|
24
|
+
...graphqlConfig.map((config) => ({
|
|
25
|
+
...config,
|
|
26
|
+
...(config.files && {
|
|
27
|
+
files: config.files.map((pattern) => pattern.replace(/^src\//, 'demo/src/')),
|
|
28
|
+
}),
|
|
29
|
+
})),
|
|
14
30
|
];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IGraphQLConfig } from '@graphql-eslint/eslint-plugin';
|
|
2
|
+
|
|
3
|
+
const config: IGraphQLConfig = {
|
|
4
|
+
schema: 'demo/src/graphql/generated/schema.graphql',
|
|
5
|
+
documents: [
|
|
6
|
+
'demo/src/graphql/**/*.graphql',
|
|
7
|
+
'!demo/src/graphql/generated/**',
|
|
8
|
+
],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default config;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@innovixx/eslint-config",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
4
|
-
"main": "
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
|
+
"main": "config/index.mjs",
|
|
5
5
|
"repository": "git@github.com:innovixx/eslint-config.git",
|
|
6
6
|
"description": "Opinionated ESLint config for JavaScript developers",
|
|
7
7
|
"author": "service@innovixx.co.uk",
|
|
@@ -13,22 +13,15 @@
|
|
|
13
13
|
"style-guide"
|
|
14
14
|
],
|
|
15
15
|
"scripts": {
|
|
16
|
-
"lint": "eslint demo/**/*.{js,jsx,ts,tsx}"
|
|
16
|
+
"lint": "eslint demo/**/*.{graphql,js,jsx,ts,tsx}"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@types/eslint": "9.6.1",
|
|
20
|
-
"@types/node": "^26.6.6",
|
|
21
|
-
"@types/react": "^19.3.0",
|
|
22
|
-
"@types/react-dom": "^19.3.0",
|
|
23
|
-
"globals": "17.14.0"
|
|
24
|
-
},
|
|
25
|
-
"peerDependencies": {
|
|
26
19
|
"@eslint-react/eslint-plugin": "^5.28.8",
|
|
27
20
|
"@eslint-react/kit": "5.28.8",
|
|
21
|
+
"@graphql-eslint/eslint-plugin": "^4.4.2",
|
|
28
22
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
29
23
|
"@typescript-eslint/eslint-plugin": "^8.72.1",
|
|
30
24
|
"@typescript-eslint/parser": "^8.72.1",
|
|
31
|
-
"eslint": "^10.14.0",
|
|
32
25
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
33
26
|
"eslint-plugin-import": "^2.32.0",
|
|
34
27
|
"eslint-plugin-jest": "^29.17.0",
|
|
@@ -36,11 +29,22 @@
|
|
|
36
29
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
37
30
|
"eslint-plugin-n": "^18.5.0",
|
|
38
31
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
39
|
-
"eslint-plugin-react-refresh": "^0.5.7",
|
|
40
32
|
"eslint-plugin-sort-export-all": "^2.1.0",
|
|
33
|
+
"globals": "17.14.0",
|
|
41
34
|
"typescript-eslint": "^8.72.1"
|
|
42
35
|
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"eslint": "^10.14.0",
|
|
38
|
+
"graphql": "^16",
|
|
39
|
+
"typescript": "6.0.3"
|
|
40
|
+
},
|
|
43
41
|
"devDependencies": {
|
|
42
|
+
"@types/eslint": "9.6.1",
|
|
43
|
+
"@types/node": "^26.6.6",
|
|
44
|
+
"@types/react": "^19.3.0",
|
|
45
|
+
"@types/react-dom": "^19.3.0",
|
|
46
|
+
"eslint": "10.14.0",
|
|
47
|
+
"graphql": "^16",
|
|
44
48
|
"typescript": "6.0.3"
|
|
45
49
|
}
|
|
46
50
|
}
|
package/demo/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|