Add eslint-plugin-relay rules (warning only)
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -6,6 +6,7 @@ export default defineConfig([
|
||||
configs.ts,
|
||||
configs.imports,
|
||||
configs.react,
|
||||
configs.relay,
|
||||
configs.stylistic,
|
||||
configs.languageOptions.browser,
|
||||
]);
|
||||
|
||||
@@ -6,6 +6,7 @@ export default defineConfig([
|
||||
configs.ts,
|
||||
configs.imports,
|
||||
configs.react,
|
||||
configs.relay,
|
||||
configs.stylistic,
|
||||
configs.languageOptions.browser,
|
||||
]);
|
||||
|
||||
19
package-lock.json
generated
19
package-lock.json
generated
@@ -5605,6 +5605,10 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/eslint-plugin-relay": {
|
||||
"resolved": "packages/eslint-relay-plugin",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@types/estree": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
|
||||
@@ -9318,6 +9322,15 @@
|
||||
"semver": "bin/semver.js"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-relay": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-relay/-/eslint-plugin-relay-2.0.0.tgz",
|
||||
"integrity": "sha512-H52u+YM72VhBwhKrGSSdsjbeAWbLIgmph3z4Hgfyqm8Jt5pP5g9PbFmBp8kk10D4vZldrbNwa0esHxDRoczprg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-scope": {
|
||||
"version": "8.4.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz",
|
||||
@@ -18004,14 +18017,20 @@
|
||||
"eslint-plugin-import-x": "^4.16.1",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^7.0.1",
|
||||
"eslint-plugin-relay": "^2.0.0",
|
||||
"globals": "^17.0.0",
|
||||
"typescript-eslint": "^8.53.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/eslint-plugin-relay": "^1.0.0",
|
||||
"eslint": "^9.39.2",
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
},
|
||||
"packages/eslint-relay-plugin": {
|
||||
"name": "@types/eslint-plugin-relay",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"packages/helpers": {
|
||||
"name": "@probo/helpers",
|
||||
"version": "1.0.0",
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"#baseConfigs": "./src/baseConfigs.ts",
|
||||
"#tsConfigs": "./src/tsConfigs.ts",
|
||||
"#reactConfigs": "./src/reactConfigs.ts",
|
||||
"#relayConfigs": "./src/relayConfigs.ts",
|
||||
"#importsConfigs": "./src/importsConfigs.ts",
|
||||
"#languageOptionsConfigs": "./src/languageOptionsConfigs.ts",
|
||||
"#stylisticConfigs": "./src/stylisticConfigs.ts"
|
||||
@@ -30,10 +31,12 @@
|
||||
"eslint-plugin-import-x": "^4.16.1",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^7.0.1",
|
||||
"eslint-plugin-relay": "^2.0.0",
|
||||
"globals": "^17.0.0",
|
||||
"typescript-eslint": "^8.53.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/eslint-plugin-relay": "^1.0.0",
|
||||
"eslint": "^9.39.2",
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { baseConfigs } from "#baseConfigs";
|
||||
import { importsConfigs } from "#importsConfigs";
|
||||
import { browserLanguageOptionsConfigs, nodeLanguageOptionsConfigs } from "#languageOptionsConfigs";
|
||||
import { reactConfigs } from "#reactConfigs";
|
||||
import { relayConfigs } from "#relayConfigs";
|
||||
import { stylisticConfigs } from "#stylisticConfigs";
|
||||
import { tsConfigs } from "#tsConfigs";
|
||||
|
||||
@@ -10,6 +11,7 @@ export const configs = {
|
||||
imports: importsConfigs,
|
||||
ts: tsConfigs,
|
||||
react: reactConfigs,
|
||||
relay: relayConfigs,
|
||||
stylistic: stylisticConfigs,
|
||||
languageOptions: {
|
||||
browser: browserLanguageOptionsConfigs,
|
||||
|
||||
11
packages/eslint-config/src/relayConfigs.ts
Normal file
11
packages/eslint-config/src/relayConfigs.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import relay from "eslint-plugin-relay";
|
||||
import type { FlatConfig } from "typescript-eslint";
|
||||
|
||||
export const relayConfigs: FlatConfig.ConfigArray = [
|
||||
{
|
||||
plugins: {
|
||||
relay: relay,
|
||||
},
|
||||
...relay.configs["ts-recommended"],
|
||||
},
|
||||
];
|
||||
29
packages/eslint-relay-plugin/index.d.ts
vendored
Normal file
29
packages/eslint-relay-plugin/index.d.ts
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
declare module "eslint-plugin-relay" {
|
||||
import type { Linter, Rule } from "eslint";
|
||||
|
||||
export const rules: {
|
||||
"graphql-syntax": Rule.RuleModule;
|
||||
"graphql-naming": Rule.RuleModule;
|
||||
"generated-typescript-types": Rule.RuleModule;
|
||||
"no-future-added-value": Rule.RuleModule;
|
||||
"unused-fields": Rule.RuleModule;
|
||||
"must-colocate-fragment-spreads": Rule.RuleModule;
|
||||
"function-required-argument": Rule.RuleModule;
|
||||
"hook-required-argument": Rule.RuleModule;
|
||||
};
|
||||
|
||||
export const configs: {
|
||||
recommended: {
|
||||
rules: Linter.RulesRecord;
|
||||
};
|
||||
"ts-recommended": {
|
||||
rules: Linter.RulesRecord;
|
||||
};
|
||||
strict: {
|
||||
rules: Linter.RulesRecord;
|
||||
};
|
||||
"ts-strict": {
|
||||
rules: Linter.RulesRecord;
|
||||
};
|
||||
};
|
||||
}
|
||||
7
packages/eslint-relay-plugin/package.json
Normal file
7
packages/eslint-relay-plugin/package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "@types/eslint-plugin-relay",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"description": "Shared ESLint configuration for Probo monorepo",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
Reference in New Issue
Block a user