@fullstacksjs/eslint-config 8.1.1 → 8.2.0

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/README.md CHANGED
@@ -70,6 +70,7 @@ It reads your root `package.json` dependencies and includes necessary rules.
70
70
  "@fullstacksjs/eslint-config/strict",
71
71
  "@fullstacksjs/eslint-config/cypress",
72
72
  "@fullstacksjs/eslint-config/storybook",
73
+ "@fullstacksjs/eslint-config/graphql", // Need extra config
73
74
  "@fullstacksjs/eslint-config/esm", // for native ESM modules
74
75
  "@fullstacksjs/eslint-config/typecheck" // ⚠️ Needs configurations (not included in default config)
75
76
  ]
@@ -92,6 +93,30 @@ If you need more advanced `typescript-eslint` rules, then you can extend from `"
92
93
  }
93
94
  ```
94
95
 
96
+ ## Graphql
97
+
98
+ To enable graphql module you need to extends from `@fullstacksjs/eslint-config/graphql` and configure schema and operations in you eslint config or graphql config. for more information checkout [here](https://github.com/B2o5T/graphql-eslint#configuration).
99
+
100
+ Here is an example:
101
+
102
+ ```jsonc
103
+ // eslintrc
104
+
105
+ {
106
+ "extends": [
107
+ ...
108
+ "@fullstacksjs/eslint-config/eslint"
109
+ ],
110
+ }
111
+ ```
112
+
113
+ ```yaml
114
+ # .graphqlrc.yml
115
+
116
+ schema: 'path/to/schema'
117
+ ```
118
+
119
+
95
120
  ## What's included?
96
121
 
97
122
  * @typescript-eslint/eslint-plugin
@@ -108,6 +133,7 @@ If you need more advanced `typescript-eslint` rules, then you can extend from `"
108
133
  * eslint-plugin-node
109
134
  * eslint-plugin-promise
110
135
  * eslint-plugin-storybook
136
+ * eslint-plugin-graphql
111
137
 
112
138
  That's all. Feel free to use 💛
113
139
 
package/base.js CHANGED
@@ -1,3 +1,4 @@
1
+ /** @type { import('eslint').Linter.Config } */
1
2
  module.exports = {
2
3
  plugins: ['prettier', 'import', 'simple-import-sort', 'promise', 'node', 'fp'],
3
4
  parserOptions: {
package/cypress.js CHANGED
@@ -1,3 +1,4 @@
1
+ /** @type { import('eslint').Linter.Config } */
1
2
  module.exports = {
2
3
  overrides: [
3
4
  {
package/esm.js CHANGED
@@ -1,3 +1,4 @@
1
+ /** @type { import('eslint').Linter.Config } */
1
2
  module.exports = {
2
3
  rules: {
3
4
  'import/extensions': 'off',
package/graphql.js ADDED
@@ -0,0 +1,11 @@
1
+ /** @type { import('eslint').Linter.Config } */
2
+ module.exports = {
3
+ overrides: [
4
+ {
5
+ files: ['*.graphql', '*.gql'],
6
+ parser: '@graphql-eslint/eslint-plugin',
7
+ plugins: ['@graphql-eslint'],
8
+ extends: './rules/graphql.js',
9
+ },
10
+ ],
11
+ };
package/index.js CHANGED
@@ -8,9 +8,11 @@ const { packageJson: pkg } = readPkgUp.sync({
8
8
 
9
9
  const packages = Packages(pkg);
10
10
 
11
+ /** @type { import('eslint').Linter.Config } */
11
12
  module.exports = {
12
13
  extends: [
13
14
  require.resolve('./base'),
15
+ require.resolve('./storybook'),
14
16
  packages.ifAnyDep('jest', () => require.resolve('./jest')),
15
17
  packages.ifAnyDep('react', () => require.resolve('./react')),
16
18
  packages.ifAnyDep('typescript', () => require.resolve('./typescript')),
package/jest.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const exts = '(js|jsx|ts|tsx)';
2
2
  const dirs = '(test|tests|__test__|__tests__|spec|specs)';
3
3
 
4
+ /** @type { import('eslint').Linter.Config } */
4
5
  module.exports = {
5
6
  overrides: [
6
7
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "8.1.1",
3
+ "version": "8.2.0",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
@@ -22,6 +22,7 @@
22
22
  "jest.js",
23
23
  "cypress.js",
24
24
  "storybook.js",
25
+ "graphql.js",
25
26
  "react.js",
26
27
  "typescript.js",
27
28
  "typecheck.js",
@@ -34,6 +35,8 @@
34
35
  "check-rules:react": "eslint-find-rules --no-core --unused ./tests/react.js",
35
36
  "check-rules:typescript": "eslint-find-rules --no-core --unused ./tests/typescript.js",
36
37
  "check-rules:cypress": "eslint-find-rules --no-core --unused ./tests/cypress.js",
38
+ "check-rules:graphql": "eslint-find-rules --no-core --unused ./tests/graphql.js",
39
+ "check-rules:storybook": "eslint-find-rules --no-core --unused ./tests/storybook.js",
37
40
  "test": "npm-run-all --parallel check-rules:*",
38
41
  "prepublishOnly": "pinst --disable",
39
42
  "postpublish": "pinst --enable",
@@ -42,6 +45,7 @@
42
45
  "main": "index.js",
43
46
  "dependencies": {
44
47
  "@frontendmonster/utils": "0.3.11",
48
+ "@graphql-eslint/eslint-plugin": "3.8.0",
45
49
  "@typescript-eslint/eslint-plugin": "5.10.2",
46
50
  "@typescript-eslint/parser": "5.10.2",
47
51
  "eslint-config-prettier": "8.3.0",
package/react.js CHANGED
@@ -1,3 +1,4 @@
1
+ /** @type { import('eslint').Linter.Config } */
1
2
  module.exports = {
2
3
  plugins: ['react', 'react-hooks', 'jsx-a11y'],
3
4
  parserOptions: {
@@ -0,0 +1,62 @@
1
+ /** @type { import('eslint').Linter.Config } */
2
+ module.exports = {
3
+ rules: {
4
+ '@graphql-eslint/alphabetize': ['warn', { fields: ['ObjectTypeDefinition'] }],
5
+ '@graphql-eslint/description-style': 'warn',
6
+ '@graphql-eslint/executable-definitions': 'off',
7
+ '@graphql-eslint/fields-on-correct-type': 'warn',
8
+ '@graphql-eslint/fragments-on-composite-type': 'warn',
9
+ '@graphql-eslint/input-name': 'warn',
10
+ '@graphql-eslint/known-argument-names': 'warn',
11
+ '@graphql-eslint/known-directives': 'warn',
12
+ '@graphql-eslint/known-fragment-names': 'warn',
13
+ '@graphql-eslint/known-type-names': 'warn',
14
+ '@graphql-eslint/lone-anonymous-operation': 'warn',
15
+ '@graphql-eslint/lone-schema-definition': 'warn',
16
+ '@graphql-eslint/match-document-filename': ['warn', { query: 'camelCase', mutation: 'camelCase', subscription: 'camelCase' }],
17
+ '@graphql-eslint/naming-convention': 'warn',
18
+ '@graphql-eslint/no-anonymous-operations': 'warn',
19
+ '@graphql-eslint/no-case-insensitive-enum-values-duplicates': 'warn',
20
+ '@graphql-eslint/no-deprecated': 'warn',
21
+ '@graphql-eslint/no-duplicate-fields': 'warn',
22
+ '@graphql-eslint/no-fragment-cycles': 'warn',
23
+ '@graphql-eslint/no-hashtag-description': 'warn',
24
+ '@graphql-eslint/no-root-type': 'off',
25
+ '@graphql-eslint/no-scalar-result-type-on-mutation': 'warn',
26
+ '@graphql-eslint/no-typename-prefix': 'warn',
27
+ '@graphql-eslint/no-undefined-variables': 'warn',
28
+ '@graphql-eslint/no-unreachable-types': 'warn',
29
+ '@graphql-eslint/no-unused-fields': 'warn',
30
+ '@graphql-eslint/no-unused-fragments': 'warn',
31
+ '@graphql-eslint/no-unused-variables': 'warn',
32
+ '@graphql-eslint/one-field-subscriptions': 'warn',
33
+ '@graphql-eslint/overlapping-fields-can-be-merged': 'warn',
34
+ '@graphql-eslint/possible-fragment-spread': 'warn',
35
+ '@graphql-eslint/possible-type-extension': 'warn',
36
+ '@graphql-eslint/provided-required-arguments': 'warn',
37
+ '@graphql-eslint/require-deprecation-date': 'warn',
38
+ '@graphql-eslint/require-deprecation-reason': 'warn',
39
+ '@graphql-eslint/require-description': 'off',
40
+ '@graphql-eslint/require-field-of-type-query-in-mutation-result': 'warn',
41
+ '@graphql-eslint/require-id-when-available': 'warn',
42
+ '@graphql-eslint/scalar-leafs': 'warn',
43
+ '@graphql-eslint/selection-set-depth': 'off',
44
+ '@graphql-eslint/strict-id-in-types': 'warn',
45
+ '@graphql-eslint/unique-argument-names': 'warn',
46
+ '@graphql-eslint/unique-directive-names': 'warn',
47
+ '@graphql-eslint/unique-directive-names-per-location': 'warn',
48
+ '@graphql-eslint/unique-enum-value-names': 'warn',
49
+ '@graphql-eslint/unique-field-definition-names': 'warn',
50
+ '@graphql-eslint/unique-fragment-name': 'warn',
51
+ '@graphql-eslint/unique-input-field-names': 'warn',
52
+ '@graphql-eslint/unique-operation-name': 'warn',
53
+ '@graphql-eslint/unique-operation-types': 'warn',
54
+ '@graphql-eslint/unique-type-names': 'warn',
55
+ '@graphql-eslint/unique-variable-names': 'warn',
56
+ '@graphql-eslint/value-literals-of-correct-type': 'warn',
57
+ '@graphql-eslint/variables-are-input-types': 'warn',
58
+ '@graphql-eslint/variables-in-allowed-position': 'warn',
59
+
60
+ 'spaced-comment': 'off',
61
+ },
62
+ };
@@ -13,5 +13,6 @@ module.exports = {
13
13
  'storybook/csf-component': 'warn',
14
14
  'storybook/no-stories-of': 'warn',
15
15
  'storybook/no-title-property-in-meta': 'warn',
16
+ 'storybook/meta-inline-properties': 'off',
16
17
  },
17
18
  };
package/storybook.js CHANGED
@@ -1,7 +1,8 @@
1
+ /** @type { import('eslint').Linter.Config } */
1
2
  module.exports = {
2
3
  overrides: [
3
4
  {
4
- plugin: ['storybook'],
5
+ plugins: ['storybook'],
5
6
  files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
6
7
  extends: ['./rules/storybook.js'],
7
8
  },
package/typecheck.js CHANGED
@@ -1,3 +1,4 @@
1
+ /** @type { import('eslint').Linter.Config } */
1
2
  module.exports = {
2
3
  overrides: [
3
4
  {
package/typescript.js CHANGED
@@ -1,3 +1,4 @@
1
+ /** @type { import('eslint').Linter.Config } */
1
2
  module.exports = {
2
3
  parser: '@typescript-eslint/parser',
3
4
  plugins: ['@typescript-eslint/eslint-plugin'],