chore: eslint setup

This commit is contained in:
mathuo 2021-10-04 20:22:05 +01:00
parent 7ec824ea01
commit 28685f679a
6 changed files with 46 additions and 23 deletions

10
.editorconfig Normal file
View File

@ -0,0 +1,10 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
quote_type = single

View File

@ -1,21 +0,0 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"no-case-declarations":"off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-non-null-assertion":"off"
}
}

19
.eslintrc.js Normal file
View File

@ -0,0 +1,19 @@
module.exports = {
root: true,
parserOptions: {
sourceType: 'module',
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
'no-case-declarations': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
},
};

3
.gitignore vendored
View File

@ -9,4 +9,5 @@ typedocs/
.build .build
storybook-static/ storybook-static/
.rollup.cache/ .rollup.cache/
test-report.xml test-report.xml
*.code-workspace

View File

@ -3,7 +3,12 @@
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace. // List of extensions which should be recommended for users of this workspace.
"recommendations": ["esbenp.prettier-vscode", "redhat.vscode-yaml"], "recommendations": [
"esbenp.prettier-vscode",
"redhat.vscode-yaml",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. // List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [] "unwantedRecommendations": []
} }

9
tsconfig.eslint.json Normal file
View File

@ -0,0 +1,9 @@
{
"compilerOptions": {
"types": ["@types/node"],
"noEmit": true,
"allowJs": true
},
"extends": "./module-build/tsconfig.esm.json",
"include": ["tests/**/*.ts", "tools/**/*.ts", ".eslintrc.js"]
}