Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Upgrade @typescript-eslint dependencies #6

Merged
merged 21 commits into from May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -10,12 +10,12 @@ Add `@deepcrawl/eslint-config` and its peer dependencies to your `package.json`:
{
"devDependencies": {
"@deepcrawl/eslint-config": "^0.1.0",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/eslint-plugin": "^3.0.0",
"eslint": "^7.0.0",
"eslint-plugin-array-func": "^3.1.5",
"eslint-plugin-array-func": "^3.1.6",
"eslint-plugin-clean-code": "^0.1.12",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jest": "^23.9.0",
"eslint-plugin-jest": "^23.13.1",
"eslint-plugin-no-loops": "^0.3.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-sonarjs": "^0.5.0",
Expand Down
104 changes: 93 additions & 11 deletions index.js
@@ -1,7 +1,6 @@
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:eslint-plugin-import/recommended",
Expand Down Expand Up @@ -30,11 +29,40 @@ module.exports = {
"@typescript-eslint/ban-types": [
"error",
{
extendDefaults: false,
types: {
Object: "Avoid using the `Object` type. Did you mean `object`?",
Boolean: "Avoid using the `Boolean` type. Did you mean `boolean`?",
Number: "Avoid using the `Number` type. Did you mean `number`?",
String: "Avoid using the `String` type. Did you mean `string`?",
String: {
message: "Use string instead",
fixWith: "string",
},
Boolean: {
message: "Use boolean instead",
fixWith: "boolean",
},
Number: {
message: "Use number instead",
fixWith: "number",
},
Symbol: {
message: "Use symbol instead",
fixWith: "symbol",
},

// object typing
Object: {
message: [
'The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.',
'- If you want a type meaning "any object", you probably want `Record<string, unknown>` instead.',
'- If you want a type meaning "any value", you probably want `unknown` instead.',
].join('\n'),
},
'{}': {
message: [
'`{}` actually means "any non-nullish value".',
'- If you want a type meaning "any object", you probably want `Record<string, unknown>` instead.',
'- If you want a type meaning "any value", you probably want `unknown` instead.',
].join('\n'),
},
},
},
],
Expand Down Expand Up @@ -62,9 +90,58 @@ module.exports = {
},
},
],
"@typescript-eslint/generic-type-naming": ["error", "^T[A-Z][a-zA-Z]+$"],
"@typescript-eslint/interface-name-prefix": ["error", "always"],
"@typescript-eslint/naming-convention": "error",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/naming-convention": [
"error",
{
selector: "default",
format: ["camelCase"],
leadingUnderscore: "allow",
trailingUnderscore: "allow",
},
{
selector: "variable",
format: ["camelCase", "PascalCase", "UPPER_CASE"],
leadingUnderscore: "allow",
trailingUnderscore: "allow",
},
{
selector: "function",
format: ["camelCase", "PascalCase"],
},
{
selector: "property",
format: ["camelCase", "PascalCase", "UPPER_CASE"],
leadingUnderscore: "allow",
trailingUnderscore: "allow",
},
{
selector: "property",
format: null,
filter: {
regex: "[- :]",
match: true,
},
},
{
selector: "enumMember",
format: ["camelCase", "PascalCase"],
},
{
selector: "typeLike",
format: ["PascalCase"],
},
{
selector: "interface",
format: ["PascalCase"],
prefix: ["I"]
},
{
selector: "typeParameter",
format: ["PascalCase"],
prefix: ["T"]
},
],
"@typescript-eslint/no-empty-function": [
"error",
{
Expand All @@ -78,7 +155,7 @@ module.exports = {
ignoreRestArgs: true,
},
],
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-inferrable-types": [
"error",
{
Expand All @@ -99,20 +176,25 @@ module.exports = {
},
],
"@typescript-eslint/no-unnecessary-type-arguments": "error",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/return-await": "error",
"@typescript-eslint/unified-signatures": "error",
"array-func/avoid-reverse": "error",
Expand Down
18 changes: 9 additions & 9 deletions package.json
Expand Up @@ -21,19 +21,19 @@
},
"scripts": {},
"dependencies": {
"@typescript-eslint/parser": "^2.34.0",
"@typescript-eslint/parser": "^3.0.0",
"eslint-config-prettier": "^6.11.0"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": ">=2.34.0",
"@typescript-eslint/eslint-plugin": "^3.0.0",
"eslint": ">=7.0.0",
"eslint-plugin-array-func": ">=3.1.5",
"eslint-plugin-clean-code": ">=0.1.12",
"eslint-plugin-import": "=>2.20.2",
"eslint-plugin-jest": ">=23.9.0",
"eslint-plugin-no-loops": ">=0.3.0",
"eslint-plugin-prettier": ">=3.1.3",
"eslint-plugin-sonarjs": ">=0.5.0",
"eslint-plugin-array-func": "^3.1.6",
"eslint-plugin-clean-code": "^0.1.12",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jest": "^23.13.1",
"eslint-plugin-no-loops": "^0.3.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-sonarjs": "^0.5.0",
"prettier": ">=2.0.5",
"typescript": ">=3.8"
}
Expand Down
30 changes: 15 additions & 15 deletions yarn.lock
Expand Up @@ -12,30 +12,30 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339"
integrity sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==

"@typescript-eslint/experimental-utils@2.34.0":
version "2.34.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz#d3524b644cdb40eebceca67f8cf3e4cc9c8f980f"
integrity sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA==
"@typescript-eslint/experimental-utils@3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.0.0.tgz#1ddf53eeb61ac8eaa9a77072722790ac4f641c03"
integrity sha512-BN0vmr9N79M9s2ctITtChRuP1+Dls0x/wlg0RXW1yQ7WJKPurg6X3Xirv61J2sjPif4F8SLsFMs5Nzte0WYoTQ==
dependencies:
"@types/json-schema" "^7.0.3"
"@typescript-eslint/typescript-estree" "2.34.0"
"@typescript-eslint/typescript-estree" "3.0.0"
eslint-scope "^5.0.0"
eslint-utils "^2.0.0"

"@typescript-eslint/parser@^2.34.0":
version "2.34.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.34.0.tgz#50252630ca319685420e9a39ca05fe185a256bc8"
integrity sha512-03ilO0ucSD0EPTw2X4PntSIRFtDPWjrVq7C3/Z3VQHRC7+13YB55rcJI3Jt+YgeHbjUdJPcPa7b23rXCBokuyA==
"@typescript-eslint/parser@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.0.0.tgz#fe9fdf18a1155c02c04220c14506a320cb6c6944"
integrity sha512-8RRCA9KLxoFNO0mQlrLZA0reGPd/MsobxZS/yPFj+0/XgMdS8+mO8mF3BDj2ZYQj03rkayhSJtF1HAohQ3iylw==
dependencies:
"@types/eslint-visitor-keys" "^1.0.0"
"@typescript-eslint/experimental-utils" "2.34.0"
"@typescript-eslint/typescript-estree" "2.34.0"
"@typescript-eslint/experimental-utils" "3.0.0"
"@typescript-eslint/typescript-estree" "3.0.0"
eslint-visitor-keys "^1.1.0"

"@typescript-eslint/typescript-estree@2.34.0":
version "2.34.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz#14aeb6353b39ef0732cc7f1b8285294937cf37d5"
integrity sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==
"@typescript-eslint/typescript-estree@3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.0.0.tgz#fa40e1b76ccff880130be054d9c398e96004bf42"
integrity sha512-nevQvHyNghsfLrrByzVIH4ZG3NROgJ8LZlfh3ddwPPH4CH7W4GAiSx5qu+xHuX5pWsq6q/eqMc1io840ZhAnUg==
dependencies:
debug "^4.1.1"
eslint-visitor-keys "^1.1.0"
Expand Down