@@ -13,9 +13,8 @@ import unusedImports from "eslint-plugin-unused-imports";
1313import globals from "globals" ;
1414
1515import { readFileSync } from "fs" ;
16- import { dirname } from "node:path" ;
17- import { fileURLToPath } from "node:url" ;
18- import { resolve } from "path" ;
16+ import { dirname , resolve } from "path" ;
17+ import { fileURLToPath } from "url" ;
1918
2019const { configs } = pkg ;
2120
@@ -206,18 +205,94 @@ const evalConfig = {
206205 "error" ,
207206 {
208207 builtinGlobals : true ,
209- allow : [
210- "location" ,
211- "event" ,
212- "history" ,
213- "name" ,
214- "status" ,
215- "Option" ,
216- "test" ,
217- "expect" ,
218- "jest" ,
219- "PropertyDefinition" ,
220- ] ,
208+ allow : [ "name" , "PropertyDefinition" ] ,
209+ } ,
210+ ] ,
211+ } ,
212+ } ;
213+
214+ const subgraphExtends = fixupConfigRules (
215+ compat . extends (
216+ "airbnb" ,
217+ "prettier" ,
218+ "plugin:import/recommended" ,
219+ "plugin:@typescript-eslint/eslint-recommended" ,
220+ "plugin:@typescript-eslint/recommended" ,
221+ "plugin:@typescript-eslint/strict" ,
222+ "plugin:@typescript-eslint/stylistic" ,
223+ "plugin:import/typescript" ,
224+ "plugin:@typescript-eslint/strict-type-checked" ,
225+ "plugin:@typescript-eslint/stylistic-type-checked" ,
226+ ) ,
227+ ) ;
228+
229+ const subgraphConfig = {
230+ files : [ "subgraph/src/**/*.ts" , "subgraph/tests/**/*.ts" ] ,
231+ extends : subgraphExtends ,
232+ plugins : sharedPlugins ,
233+ languageOptions : {
234+ parser : tsParser ,
235+ sourceType : "module" ,
236+ ecmaVersion : 2022 ,
237+ globals : globals . node ,
238+ parserOptions : {
239+ ...sharedParserOptions ,
240+ project : resolve ( __dirname , "./subgraph/tsconfig.json" ) ,
241+ } ,
242+ } ,
243+ settings : {
244+ react : { version : "999.999.999" } ,
245+ "import/ignore" : [ "^assemblyscript" ] ,
246+ "import/resolver" : {
247+ typescript : { } ,
248+ node : { extensions : [ ".ts" , ".js" ] , moduleDirectory : [ "node_modules" , "src" , "tests" , "generated" ] } ,
249+ } ,
250+ } ,
251+ linterOptions : { reportUnusedDisableDirectives : isProduction } ,
252+ rules : {
253+ ...sharedRules ,
254+ "import/no-cycle" : "off" ,
255+ "import/namespace" : "off" ,
256+ "import/named" : "off" ,
257+ "import/default" : "off" ,
258+ "import/no-extraneous-dependencies" : [
259+ "error" ,
260+ {
261+ devDependencies : [ "**/*.test.ts" , "**/tests/**" ] ,
262+ } ,
263+ ] ,
264+ "no-debugger" : isProduction ? "error" : "off" ,
265+ "no-underscore-dangle" : "error" ,
266+ "no-redeclare" : [ "error" , { builtinGlobals : true } ] ,
267+ "import/order" : [
268+ "error" ,
269+ {
270+ groups : [ "external" , "builtin" , "internal" , "type" , "parent" , "sibling" , "index" , "object" ] ,
271+ alphabetize : { order : "asc" , caseInsensitive : true } ,
272+ warnOnUnassignedImports : true ,
273+ "newlines-between" : "always" ,
274+ } ,
275+ ] ,
276+ "import/prefer-default-export" : "off" ,
277+ "import/extensions" : [ "error" , { json : "always" } ] ,
278+ "class-methods-use-this" : "off" ,
279+ "prefer-promise-reject-errors" : "off" ,
280+ "max-classes-per-file" : "off" ,
281+ "no-use-before-define" : [ "off" ] ,
282+ "no-shadow" : "off" ,
283+ curly : [ "error" , "all" ] ,
284+ "no-return-await" : "off" ,
285+ "prefer-destructuring" : "off" ,
286+ "@typescript-eslint/prefer-for-of" : "off" ,
287+ "@typescript-eslint/consistent-type-imports" : "off" ,
288+ "@typescript-eslint/explicit-member-accessibility" : [ "error" , { accessibility : "no-public" } ] ,
289+ "@typescript-eslint/explicit-module-boundary-types" : "error" ,
290+ "@typescript-eslint/no-use-before-define" : [ "error" , { functions : false , classes : false } ] ,
291+ "@typescript-eslint/no-shadow" : [
292+ "error" ,
293+ {
294+ builtinGlobals : true ,
295+ allow : [ "BigInt" , "Request" , "describe" , "afterEach" , "beforeEach" , "beforeAll" ] ,
221296 } ,
222297 ] ,
223298 } ,
@@ -228,5 +303,6 @@ const evalConfig = {
228303export default defineConfig ( [
229304 gasConfig ,
230305 evalConfig ,
231- globalIgnores ( [ "**/node_modules" , "**/dist" , "**/coverage" , "**/build" , "eslint.config.js" ] ) ,
306+ subgraphConfig ,
307+ globalIgnores ( [ "**/node_modules" , "**/dist" , "**/coverage" , "**/build" , "eslint.config.js" , "subgraph/generated" ] ) ,
232308] ) ;
0 commit comments