Switch to eslint+prettier

This commit is contained in:
Matthias Schiffer 2019-12-24 20:02:24 +01:00
parent 53c1852757
commit 2f77cf7b74
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
6 changed files with 593 additions and 264 deletions

15
.eslintrc.js Normal file
View file

@ -0,0 +1,15 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
rules: {
'prettier/prettier': 'warn',
},
};

View file

@ -1,15 +1,21 @@
{ {
"private": true, "private": true,
"scripts": { "scripts": {
"start": "electron-webpack dev" "start": "electron-webpack dev",
"lint": "eslint 'src/**/*.ts'"
}, },
"devDependencies": { "devDependencies": {
"@types/gl-matrix": "^2.4.5", "@types/gl-matrix": "^2.4.5",
"@typescript-eslint/eslint-plugin": "^2.13.0",
"@typescript-eslint/parser": "^2.13.0",
"electron": "^7.1.7", "electron": "^7.1.7",
"electron-webpack": "^2.7.4", "electron-webpack": "^2.7.4",
"electron-webpack-ts": "^3.2.0", "electron-webpack-ts": "^3.2.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
"raw-loader": "^4.0.0", "raw-loader": "^4.0.0",
"tslint": "^5.20.1",
"typescript": "^3.7.4", "typescript": "^3.7.4",
"webpack": "^4.41.4" "webpack": "^4.41.4"
}, },

10
prettier.config.js Normal file
View file

@ -0,0 +1,10 @@
module.exports = {
semi: true,
trailingComma: 'all',
arrowParens: 'always',
singleQuote: true,
jsxSingleQuote: true,
printWidth: 120,
useTabs: true,
tabWidth: 8,
};

View file

@ -1,3 +1,14 @@
{ {
"extends": "./node_modules/electron-webpack/tsconfig-base.json" "compilerOptions": {
"target": "ES2017",
"module": "commonjs",
"strict": true,
"jsx": "react",
"outDir": "dist",
"sourceMap": true,
"declaration": true
},
"include": [
"src/**/*"
]
} }

View file

@ -1,18 +0,0 @@
{
"defaultSeverity": "warning",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"curly": false,
"indent": [true, "tabs"],
"interface-name": false,
"max-classes-per-file": false,
"no-bitwise": false,
"object-literal-sort-keys": false,
"one-variable-per-declaration": false,
"quotemark": [true, "single", "avoid-escape", "avoid-template"]
},
"rulesDirectory": []
}

791
yarn.lock

File diff suppressed because it is too large Load diff