-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade ESLint, rework config, split out Prettier (#141)
- Loading branch information
1 parent
49aae1e
commit d03dbfa
Showing
6 changed files
with
2,992 additions
and
2,109 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,4 @@ jobs: | |
|
||
- run: npm install-ci-test | ||
|
||
- run: npm run eslint | ||
- run: npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import path from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
|
||
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat' | ||
import { FlatCompat } from '@eslint/eslintrc' | ||
import js from '@eslint/js' | ||
import typescriptEslint from '@typescript-eslint/eslint-plugin' | ||
import tsParser from '@typescript-eslint/parser' | ||
import _import from 'eslint-plugin-import' | ||
import n from 'eslint-plugin-n' | ||
import simpleImportSort from 'eslint-plugin-simple-import-sort' | ||
import globals from 'globals' | ||
|
||
const __filename = fileURLToPath(import.meta.url) | ||
const __dirname = path.dirname(__filename) | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all, | ||
}) | ||
|
||
export default [ | ||
...fixupConfigRules( | ||
compat.extends( | ||
'eslint:recommended', | ||
'plugin:import/typescript', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended' | ||
) | ||
), | ||
{ | ||
plugins: { | ||
import: fixupPluginRules(_import), | ||
'simple-import-sort': simpleImportSort, | ||
n, | ||
'@typescript-eslint': fixupPluginRules(typescriptEslint), | ||
}, | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
|
||
parser: tsParser, | ||
ecmaVersion: 5, | ||
sourceType: 'commonjs', | ||
}, | ||
|
||
rules: { | ||
'import/no-cycle': 'error', | ||
'n/no-extraneous-import': 'error', | ||
'@typescript-eslint/ban-ts-ignore': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
'@typescript-eslint/interface-name-prefix': 'off', | ||
'@typescript-eslint/member-delimiter-style': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-non-null-assertion': 'error', | ||
'simple-import-sort/imports': 'error', | ||
'simple-import-sort/exports': 'error', | ||
}, | ||
}, | ||
{ | ||
files: ['test/**'], | ||
|
||
rules: { | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
}, | ||
}, | ||
] |
Oops, something went wrong.