Skip to content

Commit

Permalink
ESLint 9.x
Browse files Browse the repository at this point in the history
  • Loading branch information
klein0r committed Jun 27, 2024
1 parent ea5cf34 commit 5b7d3c6
Show file tree
Hide file tree
Showing 6 changed files with 328 additions and 282 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

57 changes: 0 additions & 57 deletions .eslintrc.json

This file was deleted.

70 changes: 70 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
const tsParser = require("@typescript-eslint/parser");
const js = require("@eslint/js");

const {
FlatCompat,
} = require("@eslint/eslintrc");

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

module.exports = [{
ignores: [
".dev-server/**",
"**/build/",
"**/.prettierrc.js",
"**/.eslintrc.js",
"admin/blockly.js",
"admin/words.js",
],
}, ...compat.extends("plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"), {
plugins: {},

languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
sourceType: "module",

parserOptions: {
project: "./tsconfig.json",
},
},

rules: {
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-explicit-any": "off",

"@typescript-eslint/no-use-before-define": ["error", {
functions: false,
typedefs: false,
classes: false,
}],

"@typescript-eslint/no-unused-vars": ["error", {
ignoreRestSiblings: true,
argsIgnorePattern: "^_",
}],

"@typescript-eslint/explicit-function-return-type": ["warn", {
allowExpressions: true,
allowTypedFunctionExpressions: true,
}],

"@typescript-eslint/no-object-literal-type-assertion": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-namespace": "off",
"no-var": "error",
"prefer-const": "error",
"no-trailing-spaces": "error",
},
}, {
files: ["**/*.test.ts"],

rules: {
"@typescript-eslint/explicit-function-return-type": "off",
},
}];
Loading

0 comments on commit 5b7d3c6

Please sign in to comment.