Add eslint rules.

main
greatbody 2023-03-14 16:34:18 +08:00
parent 3b54472115
commit 49ae70d3c3
No known key found for this signature in database
GPG Key ID: 01CEB6267272A9A5
5 changed files with 2088 additions and 11 deletions

20
.eslintrc.js Normal file
View File

@ -0,0 +1,20 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
],
globals: {
"console": "readonly"
},
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"no-undef": "warn",
"no-console": "off",
"semi": ['error', 'always']
},
};

View File

@ -18,7 +18,7 @@
- [x] TypeScript
- [x] Webpack
- [ ] Eslint
- [x] Eslint
---
@ -30,7 +30,7 @@ Supported features:
- [x] TypeScript
- [x] Webpack
- [ ] Eslint
- [x] Eslint
---
@ -42,7 +42,7 @@ Supported features:
- [x] TypeScript
- [x] Webpack
- [ ] Eslint
- [x] Eslint
---
@ -54,7 +54,7 @@ Funcionalidades soportadas:
- [x] TypeScript
- [x] Webpack
- [ ] Eslint
- [x] Eslint
---
@ -66,7 +66,7 @@ Fonctionnalités prises en charge :
- [x] TypeScript
- [x] Webpack
- [ ] Eslint
- [x] Eslint
---
@ -78,4 +78,4 @@ Unterstützte Funktionen:
- [x] TypeScript
- [x] Webpack
- [ ] Eslint
- [x] Eslint

2053
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,11 +5,15 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack"
"build": "webpack",
"lint": "eslint src"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"eslint": "^8.36.0",
"ts-loader": "^9.4.2",
"typescript": "^4.9.5",
"webpack": "^5.76.1",

View File

@ -1,6 +1,6 @@
class Roy {
name: string
age: number
name: string;
age: number;
constructor(name: string, age: number) {
this.name = name;
@ -8,8 +8,8 @@ class Roy {
}
play = () => {
console.log(`Hi, I am ${this.name}, I am ${this.age} years old`)
}
console.log(`Hi, I am ${this.name}, I am ${this.age} years old`);
};
}
const roy = new Roy("Roy", 57);