Skip to content

Commit

Permalink
Update to use ESLint 9 and Prettier 3 (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenjohanson authored Dec 19, 2024
1 parent 3e55b61 commit 3177c14
Show file tree
Hide file tree
Showing 35 changed files with 11,593 additions and 13,604 deletions.
45 changes: 0 additions & 45 deletions teammapper-backend/.eslintrc.json

This file was deleted.

78 changes: 78 additions & 0 deletions teammapper-backend/eslint.config.cjs
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",
}],
},
},
];
Loading

0 comments on commit 3177c14

Please sign in to comment.