Skip to content

Commit

Permalink
feat(base): update env and import/resolver
Browse files Browse the repository at this point in the history
Adds configuration to the base config that stops unresolved import issues, and supports browser and node env vars.
  • Loading branch information
theurgi committed Mar 1, 2023
1 parent ab95074 commit 08b5399
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/rules/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ export = defineConfig(
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro'],
},

settings: {
'import/resolver': {
typescript: {},
},
},
},
],
}
Expand Down
11 changes: 11 additions & 0 deletions src/rules/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export = defineConfig({
extends: 'eslint:recommended',

env: {
browser: true,
node: true,
/**
* Globals shared across Node.js and Browser
* https://github.com/sindresorhus/globals/blob/v13.18.0/globals.json#L1711
Expand All @@ -21,4 +23,13 @@ export = defineConfig({
rules: {
'no-restricted-globals': ['error', ...confusingBrowserGlobals],
},

settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
typescript: {},
},
},
})

0 comments on commit 08b5399

Please sign in to comment.