add prettier and eslint

This commit is contained in:
Johannes Loher 2020-12-23 17:26:53 +01:00
parent 4f6a9b7e73
commit 618146226b
5 changed files with 1161 additions and 8 deletions

19
.eslintrc.js Normal file
View file

@ -0,0 +1,19 @@
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of imports
},
extends: [
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended", // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
},
};

View file

@ -1,7 +0,0 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": false,
"printWidth": 120
}

8
.prettierrc.js Normal file
View file

@ -0,0 +1,8 @@
module.exports = {
semi: true,
trailingComma: "all",
singleQuote: false,
printWidth: 120,
tabWidth: 4,
editorconfig: true
};

1126
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -8,13 +8,19 @@
"build": "gulp build && gulp link",
"build:watch": "gulp watch",
"clean": "gulp clean && gulp link --clean",
"update": "npm install --save-dev gitlab:foundry-projects/foundry-pc/foundry-pc-types"
"update": "npm install --save-dev gitlab:foundry-projects/foundry-pc/foundry-pc-types",
"lint": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix"
},
"author": "",
"license": "",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.11.0",
"@typescript-eslint/parser": "^4.11.0",
"archiver": "^5.1.0",
"chalk": "^4.1.0",
"eslint": "^7.16.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-prettier": "^3.3.0",
"foundry-pc-types": "gitlab:foundry-projects/foundry-pc/foundry-pc-types",
"fs-extra": "^9.0.1",
"gulp": "^4.0.2",
@ -23,6 +29,7 @@
"gulp-sass": "^4.1.0",
"gulp-typescript": "^6.0.0-alpha.1",
"json-stringify-pretty-compact": "^2.0.0",
"prettier": "^2.2.1",
"sass": "^1.30.0",
"typescript": "^4.1.3",
"yargs": "^16.2.0"