@innovixx/eslint-config 4.0.0-alpha.0 → 4.0.0-alpha.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.
@@ -14,6 +14,7 @@ import variableRules from './rules/variables.mjs';
14
14
 
15
15
  export const index = deepMerge(
16
16
  {
17
+ files: ['**/*.{js,jsx,ts,tsx}'],
17
18
  languageOptions: {
18
19
  globals: {
19
20
  ...globals.node,
@@ -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;
@@ -10,6 +10,7 @@ import { deepMerge } from '../../deepMerge.mjs';
10
10
 
11
11
  export const index = deepMerge(
12
12
  {
13
+ files: ['**/*.test.{js,jsx,ts,tsx}'],
13
14
  languageOptions: {
14
15
  globals: {
15
16
  ...globals.jest,
@@ -10,6 +10,7 @@ import { customReactConfig } from './rules/custom-rules.mjs';
10
10
 
11
11
  /** @type {import('eslint').Linter.Config} */
12
12
  export const index = {
13
+ files: ['**/*.{jsx,tsx}'],
13
14
  languageOptions: {
14
15
  globals: {
15
16
  ...globals.browser,
@@ -8,6 +8,7 @@ import { deepMerge } from '../../deepMerge.mjs';
8
8
 
9
9
  export const index = deepMerge(
10
10
  {
11
+ files: ['**/*.{ts,tsx}'],
11
12
  settings: typeScriptSettings.settings,
12
13
  },
13
14
  {
@@ -0,0 +1,7 @@
1
+ type Test {
2
+ id: ID!
3
+ }
4
+
5
+ type Query {
6
+ test: Test
7
+ }
@@ -0,0 +1,5 @@
1
+ query Test {
2
+ test {
3
+ id
4
+ }
5
+ }
package/eslint.config.mjs CHANGED
@@ -1,14 +1,23 @@
1
+ import { defineConfig } from 'eslint/config';
1
2
  import baseConfig from './config/configs/base/index.mjs';
2
3
  import reactConfig from './config/configs/react/index.mjs';
3
4
  import typescriptConfig from './config/configs/typescript/index.mjs';
4
- import jestConfig from './config/configs/jest/index.mjs';
5
+ import { graphqlConfig } from './config/configs/graphql/index.mjs';
5
6
 
6
- export default [
7
+ export default defineConfig([
7
8
  baseConfig,
8
9
  reactConfig,
9
10
  typescriptConfig,
10
- jestConfig,
11
11
  {
12
- files: ['**/*.{js,jsx,ts,tsx}'],
12
+ basePath: 'demo',
13
+ extends: [graphqlConfig],
13
14
  },
14
- ];
15
+ {
16
+ files: ['codegen.ts', '*.config.ts'],
17
+ languageOptions: {
18
+ parserOptions: {
19
+ project: null,
20
+ },
21
+ },
22
+ },
23
+ ]);
@@ -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.0",
4
- "main": "configs/index.mjs",
3
+ "version": "4.0.0-alpha.2",
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