Skip to content

Commit

Permalink
Switch to eslint
Browse files Browse the repository at this point in the history
fix #335
  • Loading branch information
silkentrance committed Nov 11, 2022
1 parent e68ed4f commit b1572cb
Show file tree
Hide file tree
Showing 21 changed files with 1,120 additions and 34 deletions.
9 changes: 2 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
attic
!karma.conf.js
!webpack.config.js
!jest.config.js
*.js
*.js.map
*.tgz
*.swp
package-lock.json
*debug.log
.nyc_output
.DS_Store
dist
node_modules/
.idea/
node_modules
.idea
coverage
CHANGELOG.new.md
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"scripts": {
"postinstall": "lerna bootstrap --no-ci",
"test": "lerna run --stream test",
"tslint": "lerna run --stream tslint",
"tslint-fix": "lerna run --stream tslint-fix",
"lint": "lerna run --stream lint",
"lint-fix": "lerna run --stream lint-fix",
"lerna-publish": "lerna publish",
"changelog": "lerna-changelog"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/core/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage
dist
.eslintrc.js
176 changes: 176 additions & 0 deletions packages/core/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
/*
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
https://github.com/typescript-eslint/tslint-to-eslint-config
It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.
We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint.
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
Happy linting! 💖
*/
module.exports = {
"env": {
"browser": true,
"es6": true
},
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"eslint-plugin-prefer-arrow",
"eslint-plugin-import",
"eslint-plugin-jsdoc",
"@typescript-eslint"
],
"root": true,
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": [
"error",
{
"default": "array"
}
],
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": [
"camelCase",
"UPPER_CASE",
"PascalCase"
],
"leadingUnderscore": "allow",
"trailingUnderscore": "forbid"
}
],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-shadow": [
"off",
{
"hoist": "all"
}
],
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/triple-slash-reference": [
"off",
{
"path": "always",
"types": "prefer-import",
"lib": "always"
}
],
"@typescript-eslint/typedef": "off",
"@typescript-eslint/unified-signatures": "error",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/require-await": "warn",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/restrict-template-expressions": "warn",
"@typescript-eslint/no-inferrable-types": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-this-alias": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/unbound-method": "warn",
"comma-dangle": "off",
"complexity": "off",
"constructor-super": "error",
"dot-notation": "off",
"eqeqeq": [
"error",
"smart"
],
"guard-for-in": "off",
"id-denylist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined"
],
"id-match": "error",
"import/no-deprecated": "error",
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": "warn",
"jsdoc/newline-after-description": "warn",
"max-classes-per-file": "off",
"max-len": "off",
"new-parens": "error",
"no-bitwise": "off",
"no-caller": "error",
"no-cond-assign": "error",
"no-console": "off",
"no-debugger": "error",
"no-empty": "off",
"no-empty-function": "off",
"no-eval": "error",
"no-fallthrough": "off",
"no-invalid-this": "off",
"no-new-wrappers": "error",
"no-shadow": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-underscore-dangle": "off",
"no-unsafe-finally": "error",
"no-unused-expressions": "off",
"no-unused-labels": "error",
"no-use-before-define": "off",
"no-var": "warn",
"object-shorthand": "error",
"one-var": [
"error",
"never"
],
"prefer-arrow/prefer-arrow-functions": "off",
"prefer-const": "warn",
"prefer-rest-params": "warn",
"radix": "error",
"spaced-comment": [
"error",
"always",
{
"markers": [
"/"
]
}
],
"use-isnan": "error",
"valid-typeof": "off"
}
};
13 changes: 9 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"scripts": {
"prepare": "tsc",
"pretest": "tsc",
"test": "nyc mocha && tslint --project .",
"tslint": "tslint --project .",
"tslint-fix": "tslint --project . --fix"
"test": "nyc mocha && npm run lint",
"lint": "eslint .",
"lint-fix": "eslint --fix ."
},
"files": [
"dist/index.js",
Expand All @@ -48,12 +48,17 @@
"@types/chai-as-promised": "latest",
"@types/mocha": "latest",
"@types/node": "latest",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"chai": "latest",
"chai-as-promised": "latest",
"eslint": "latest",
"eslint-plugin-import": "latest",
"eslint-plugin-jsdoc": "latest",
"eslint-plugin-prefer-arrow": "latest",
"mocha": "latest",
"nyc": "latest",
"ts-node": "latest",
"tslint": "latest",
"typescript": "latest"
},
"publishConfig": {
Expand Down
2 changes: 2 additions & 0 deletions packages/di-typedi/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
.eslintrc.js

0 comments on commit b1572cb

Please sign in to comment.