-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to use ESLint 9 and Prettier 3 (#504)
- Loading branch information
1 parent
3e55b61
commit 3177c14
Showing
35 changed files
with
11,593 additions
and
13,604 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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
const { fixupConfigRules, fixupPluginRules } = require("@eslint/compat"); | ||
const tseslint = require("typescript-eslint"); | ||
const jest = require("eslint-plugin-jest"); | ||
const importPlugin = require("eslint-plugin-import"); | ||
const globals = require("globals"); | ||
const tsParser = require("@typescript-eslint/parser"); | ||
const js = require("@eslint/js"); | ||
const prettier = require("eslint-plugin-prettier"); | ||
const stylisticTs = require("@stylistic/eslint-plugin-ts"); | ||
|
||
const { FlatCompat } = require("@eslint/eslintrc"); | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
module.exports = [ | ||
{ | ||
ignores: ["src/migrations/**/*", "dist/**/*", "src/jobs/**/*"], | ||
}, | ||
js.configs.recommended, | ||
importPlugin.flatConfigs.recommended, | ||
...tseslint.configs.recommended, | ||
{ | ||
files: ["**/*.ts"], | ||
plugins: { | ||
jest: jest, | ||
prettier: prettier, | ||
"@stylistic/ts": stylisticTs | ||
}, | ||
languageOptions: { | ||
globals: { | ||
...jest.environments.globals.globals, | ||
...globals.node, | ||
}, | ||
parser: tsParser, | ||
parserOptions: { | ||
project: ["tsconfig.json"], | ||
ecmaVersion: 12, | ||
sourceType: "module", | ||
}, | ||
}, | ||
settings: { | ||
"import/resolver": { | ||
typescript: {}, | ||
node: { | ||
extensions: [".js", ".ts"], | ||
moduleDirectory: ["node_modules", "src/"], | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
"@typescript-eslint/no-explicit-any": "warn", | ||
"prettier/prettier": "error", | ||
"no-unused-vars": "off", | ||
"@stylistic/ts/member-delimiter-style": ["error", { | ||
"multiline": { | ||
"delimiter": "none", | ||
"requireLast": true | ||
}, | ||
"singleline": { | ||
"delimiter": "semi", | ||
"requireLast": false | ||
}, | ||
"multilineDetection": "brackets" | ||
}], | ||
"@typescript-eslint/no-unused-vars": ["error", { | ||
argsIgnorePattern: "^_", | ||
}], | ||
"import/extensions": ["error", "ignorePackages", { | ||
js: "never", | ||
ts: "never", | ||
}], | ||
}, | ||
}, | ||
]; |
Oops, something went wrong.