chore: configure eslint (#123)

Added `eslint` to project and configured it. The fixes will be applied later.
```
Found 1855 problems (709 errors, 1146 warnings) 🙈 
628 errors and 291 warnings potentially fixable with the `--fix` option.
```
development
Анатолий Майоров 2022-10-23 10:41:41 +03:00 committed by GitHub
parent 1eabc24777
commit 3527a77eb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 2 deletions

2
.eslintignore Normal file
View File

@ -0,0 +1,2 @@
**/dist/**
**/node_modules/**

27
.eslintrc.json Normal file
View File

@ -0,0 +1,27 @@
{
"root": true,
"env": {
"browser": true,
"es2020": true
},
"plugins": [
"@typescript-eslint",
"eslint-plugin-import"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-misleading-character-class": "warn",
"no-dupe-else-if": "warn",
"no-warning-comments": "warn",
"import/no-absolute-path": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-unused-vars": "off"
}
}

View File

@ -15,7 +15,10 @@
"dev": "node ./scripts/dev",
"bootstrap": "lerna bootstrap --no-ci",
"postinstall": "lerna bootstrap --no-ci",
"docs": "jsdoc -c jsdoc.json"
"docs": "jsdoc -c jsdoc.json",
"lint": "eslint packages/**/**.ts",
"lint:fix": "eslint --fix packages/**/**.ts",
"prettier": "prettier --write packages/*/src/**/*.ts"
},
"devDependencies": {
"@babel/core": "^7.16.0",
@ -24,6 +27,8 @@
"@babel/preset-react": "^7.16.0",
"@babel/preset-typescript": "^7.16.0",
"@lerna/filter-options": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^5.39.0",
"@typescript-eslint/parser": "^5.39.0",
"babel-loader": "^8.2.3",
"better-docs": "^2.3.2",
"cross-env": "~7.0.3",
@ -31,7 +36,7 @@
"file-loader": "^6.2.0",
"jsdoc": "^3.6.7",
"lerna": "^4.0.0",
"prettier": "^2.5.0",
"prettier": "^2.7.1",
"style-loader": "^3.3.1",
"typedoc": "^0.23.15",
"typescript": "^4.8.3",