@@ -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,93 @@ 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/stylistic-type-checked" ,
225+ ) ,
226+ ) ;
227+
228+ const subgraphConfig = {
229+ files : [ "subgraph/src/**/*.ts" , "subgraph/tests/**/*.ts" ] ,
230+ extends : subgraphExtends ,
231+ plugins : sharedPlugins ,
232+ languageOptions : {
233+ parser : tsParser ,
234+ sourceType : "module" ,
235+ ecmaVersion : 2022 ,
236+ globals : globals . node ,
237+ parserOptions : {
238+ ...sharedParserOptions ,
239+ project : resolve ( __dirname , "./subgraph/tsconfig.json" ) ,
240+ } ,
241+ } ,
242+ settings : {
243+ react : { version : "999.999.999" } ,
244+ "import/ignore" : [ "^assemblyscript" , "^\\.\\./generated" ] ,
245+ "import/resolver" : {
246+ typescript : { } ,
247+ node : { extensions : [ ".ts" , ".js" ] , moduleDirectory : [ "node_modules" , "src" , "tests" , "generated" ] } ,
248+ } ,
249+ } ,
250+ linterOptions : { reportUnusedDisableDirectives : isProduction } ,
251+ rules : {
252+ ...sharedRules ,
253+ "import/no-cycle" : "off" ,
254+ "import/namespace" : "off" ,
255+ "import/named" : "off" ,
256+ "import/default" : "off" ,
257+ "import/no-extraneous-dependencies" : [
258+ "error" ,
259+ {
260+ devDependencies : [ "**/*.test.ts" , "**/tests/**" ] ,
261+ } ,
262+ ] ,
263+ "no-debugger" : isProduction ? "error" : "off" ,
264+ "no-underscore-dangle" : "error" ,
265+ "no-redeclare" : [ "error" , { builtinGlobals : true } ] ,
266+ "import/order" : [
267+ "error" ,
268+ {
269+ groups : [ "external" , "builtin" , "internal" , "type" , "parent" , "sibling" , "index" , "object" ] ,
270+ alphabetize : { order : "asc" , caseInsensitive : true } ,
271+ warnOnUnassignedImports : true ,
272+ "newlines-between" : "always" ,
273+ } ,
274+ ] ,
275+ "import/prefer-default-export" : "off" ,
276+ "import/extensions" : [ "error" , { json : "always" } ] ,
277+ "class-methods-use-this" : "off" ,
278+ "prefer-promise-reject-errors" : "off" ,
279+ "max-classes-per-file" : "off" ,
280+ "no-use-before-define" : [ "off" ] ,
281+ "no-shadow" : "off" ,
282+ curly : [ "error" , "all" ] ,
283+ "no-return-await" : "off" ,
284+ "prefer-destructuring" : "off" ,
285+ "@typescript-eslint/prefer-for-of" : "off" ,
286+ "@typescript-eslint/consistent-type-imports" : "off" ,
287+ "@typescript-eslint/explicit-member-accessibility" : [ "error" , { accessibility : "no-public" } ] ,
288+ "@typescript-eslint/explicit-module-boundary-types" : "error" ,
289+ "@typescript-eslint/no-use-before-define" : [ "error" , { functions : false , classes : false } ] ,
290+ "@typescript-eslint/no-shadow" : [
291+ "error" ,
292+ {
293+ builtinGlobals : true ,
294+ allow : [ "BigInt" , "Request" , "describe" , "afterEach" , "beforeEach" , "beforeAll" ] ,
221295 } ,
222296 ] ,
223297 } ,
@@ -228,5 +302,6 @@ const evalConfig = {
228302export default defineConfig ( [
229303 gasConfig ,
230304 evalConfig ,
231- globalIgnores ( [ "**/node_modules" , "**/dist" , "**/coverage" , "**/build" , "eslint.config.js" ] ) ,
305+ subgraphConfig ,
306+ globalIgnores ( [ "**/node_modules" , "**/dist" , "**/coverage" , "**/build" , "eslint.config.js" , "subgraph/generated" ] ) ,
232307] ) ;
0 commit comments