@avivox-monorepo/eslint-config 0.1.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/default.js +11 -0
- package/graphql.js +70 -0
- package/native.js +11 -0
- package/node.js +11 -0
- package/package.json +27 -0
- package/react.js +21 -0
package/default.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const { defineConfig } = require("eslint/config");
|
|
2
|
+
const universeConfig = require("eslint-config-universe/flat/default.js");
|
|
3
|
+
|
|
4
|
+
module.exports = defineConfig([
|
|
5
|
+
universeConfig,
|
|
6
|
+
{
|
|
7
|
+
rules: {
|
|
8
|
+
"prettier/prettier": ["error", { endOfLine: "auto" }],
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
]);
|
package/graphql.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const { default: graphqlPlugin } = require("@graphql-eslint/eslint-plugin");
|
|
2
|
+
const { defineConfig } = require("eslint/config");
|
|
3
|
+
|
|
4
|
+
const jsTsFileProcessorConfig = {
|
|
5
|
+
files: ["**/*.{ts,js,tsx,jsx}"],
|
|
6
|
+
// Setup processor for operations/fragments definitions on code-files
|
|
7
|
+
processor: graphqlPlugin.processor,
|
|
8
|
+
languageOptions: {
|
|
9
|
+
parserOptions: {
|
|
10
|
+
ecmaFeatures: {
|
|
11
|
+
jsx: true,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const graphqlFileParserConfig = {
|
|
18
|
+
// Setup GraphQL Parser
|
|
19
|
+
files: ["**/*.{graphql,gql}"],
|
|
20
|
+
languageOptions: {
|
|
21
|
+
parser: graphqlPlugin.parser,
|
|
22
|
+
},
|
|
23
|
+
plugins: {
|
|
24
|
+
"@graphql-eslint": graphqlPlugin,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const schemaRecommendedRules = {
|
|
29
|
+
// Setup recommended config for schema files
|
|
30
|
+
...graphqlPlugin.configs["flat/schema-recommended"].rules,
|
|
31
|
+
"@graphql-eslint/require-description": ["off"],
|
|
32
|
+
"@graphql-eslint/strict-id-in-types": ["off"],
|
|
33
|
+
"@graphql-eslint/no-unreachable-types": ["off"],
|
|
34
|
+
"@graphql-eslint/naming-convention": ["off"],
|
|
35
|
+
"@graphql-eslint/no-hashtag-description": ["off"],
|
|
36
|
+
"@graphql-eslint/no-typename-prefix": ["off"],
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const operationsRules = {
|
|
40
|
+
// Setup recommended config for operations files
|
|
41
|
+
...graphqlPlugin.configs["flat/operations-recommended"].rules,
|
|
42
|
+
"@graphql-eslint/naming-convention": ["off"],
|
|
43
|
+
"@graphql-eslint/require-description": ["off"],
|
|
44
|
+
"@graphql-eslint/no-hashtag-description": ["off"],
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// --------------------------------------------------------------------
|
|
48
|
+
const schemaConfig = defineConfig([
|
|
49
|
+
jsTsFileProcessorConfig,
|
|
50
|
+
{
|
|
51
|
+
...graphqlFileParserConfig,
|
|
52
|
+
rules: {
|
|
53
|
+
...schemaRecommendedRules,
|
|
54
|
+
"prettier/prettier": "error",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
]);
|
|
58
|
+
|
|
59
|
+
const operationsRulesConfig = defineConfig([
|
|
60
|
+
jsTsFileProcessorConfig,
|
|
61
|
+
{
|
|
62
|
+
...graphqlFileParserConfig,
|
|
63
|
+
rules: {
|
|
64
|
+
...operationsRules,
|
|
65
|
+
"prettier/prettier": "error",
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
module.exports = { schemaConfig, operationsRulesConfig };
|
package/native.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const { defineConfig } = require("eslint/config");
|
|
2
|
+
const universeConfig = require("eslint-config-universe/flat/native.js");
|
|
3
|
+
|
|
4
|
+
module.exports = defineConfig([
|
|
5
|
+
universeConfig,
|
|
6
|
+
{
|
|
7
|
+
rules: {
|
|
8
|
+
"prettier/prettier": ["error", { endOfLine: "auto" }],
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
]);
|
package/node.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const { defineConfig } = require("eslint/config");
|
|
2
|
+
const universeConfig = require("eslint-config-universe/flat/node.js");
|
|
3
|
+
|
|
4
|
+
module.exports = defineConfig([
|
|
5
|
+
universeConfig,
|
|
6
|
+
{
|
|
7
|
+
rules: {
|
|
8
|
+
"prettier/prettier": ["error", { endOfLine: "auto" }],
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
]);
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@avivox-monorepo/eslint-config",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"author": "https://github.com/abhisin98",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "default.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"default.js",
|
|
9
|
+
"graphql.js",
|
|
10
|
+
"native.js",
|
|
11
|
+
"node.js",
|
|
12
|
+
"react.js"
|
|
13
|
+
],
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@graphql-eslint/eslint-plugin": "^4.4.0",
|
|
16
|
+
"eslint-config-universe": "^15.0.3"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"eslint": ">=8.51",
|
|
20
|
+
"prettier": ">=3.0"
|
|
21
|
+
},
|
|
22
|
+
"peerDependenciesMeta": {
|
|
23
|
+
"prettier": {
|
|
24
|
+
"optional": true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
package/react.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const { defineConfig } = require("eslint/config");
|
|
2
|
+
const universeConfig = require("eslint-config-universe/flat/web.js");
|
|
3
|
+
|
|
4
|
+
module.exports = defineConfig([
|
|
5
|
+
universeConfig,
|
|
6
|
+
{
|
|
7
|
+
rules: {
|
|
8
|
+
"prettier/prettier": ["error", { endOfLine: "auto" }],
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
// module.exports = {
|
|
14
|
+
// // --------------------------------------------------------------------
|
|
15
|
+
// extends: ["eslint-config-universe/shared/core.js", "eslint-config-universe/shared/typescript.js", "eslint-config-universe/shared/react.js", "eslint-config-universe/shared/prettier.js"],
|
|
16
|
+
// env: { browser: true, commonjs: true },
|
|
17
|
+
// // do some additional things with it
|
|
18
|
+
// rules: {
|
|
19
|
+
// "prettier/prettier": ["error", { endOfLine: "auto" }],
|
|
20
|
+
// },
|
|
21
|
+
// };
|