Skip to content

Commit

Permalink
initial eslint.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonFischer04 committed Apr 7, 2024
1 parent 985c68b commit 7351ed2
Show file tree
Hide file tree
Showing 5 changed files with 1,645 additions and 5,344 deletions.
File renamed without changes.
File renamed without changes.
76 changes: 76 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
const typescriptPlugin = require('@typescript-eslint/eslint-plugin');
const typescriptParser = require('@typescript-eslint/parser');

// TODO: prettier

const config = [
{
ignores: [
'build/**',
'test/baselines/**'
],
},

// ts specific overrides
// https://typescript-eslint.io/rules/
{
files: ['**/*.{ts,mts,cts,tsx}'],

languageOptions: {
parser: typescriptParser,
parserOptions: {
project: true
}
},
plugins: {
'@typescript-eslint': typescriptPlugin
},
rules: {
...typescriptPlugin.configs['recommended'].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", // This is necessary for Map.has()/get()!
"@typescript-eslint/no-inferrable-types": [
"error",
{
ignoreParameters: true,
ignoreProperties: true,
},
],
}
},

{
files: ["**/*.test.ts"],
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
},
}
];

module.exports = config;
Loading

0 comments on commit 7351ed2

Please sign in to comment.