Skip to content

Commit

Permalink
✨ feat: upgrade rules and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
MrJmpl3 committed Jun 17, 2024
1 parent 040e86a commit 2767b62
Show file tree
Hide file tree
Showing 9 changed files with 1,513 additions and 1,741 deletions.
6 changes: 1 addition & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line @typescript-eslint/unbound-method
const { resolve } = require('path');

module.exports = {
Expand All @@ -7,11 +6,8 @@ module.exports = {
project: resolve(__dirname, './tsconfig.json'),
tsconfigRootDir: __dirname,
},
extends: [require.resolve('./index'), 'prettier'],
extends: [require.resolve('./without-ts-type-checking'), 'prettier'],
rules: {
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
};
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit "$1"
3,148 changes: 1,462 additions & 1,686 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-airbnb-typescript-base",
"version": "5.0.1",
"version": "6.0.0",
"description": "Airbnb Base Typescript config",
"license": "MIT",
"author": "José Manuel Casani Guerra <[email protected]>",
Expand All @@ -14,24 +14,24 @@
"validate": "npm run lint"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"confusing-browser-globals": "^1.0.11",
"eslint": "^8.53.0",
"eslint": "^8.57.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-import-resolver-webpack": "^0.13.8",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-typescript-sort-keys": "^3.1.0"
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-typescript-sort-keys": "^3.2.0",
"typescript": "^5.4.5"
},
"devDependencies": {
"commitlint": "^18.4.1",
"commitlint": "^19.3.0",
"commitlint-config-gitmoji": "^2.3.1",
"eslint-config-prettier": "^9.0.0",
"husky": "^8.0.3",
"lint-staged": "^15.1.0",
"prettier": "^3.1.0",
"prettier-package-json": "^2.8.0",
"typescript": "^5.2.2"
"eslint-config-prettier": "^9.1.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"prettier": "^3.3.2",
"prettier-package-json": "^2.8.0"
},
"lint-staged": {
"*.{js,ts}": "eslint"
Expand Down
26 changes: 15 additions & 11 deletions rules/bestPractices.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ module.exports = {
'default-case-last': 'error',

// Replace Airbnb 'default-param-last' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/default-param-last.md
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/default-param-last.mdx
'default-param-last': 'off',
'@typescript-eslint/default-param-last': 'error',

// Replace Airbnb 'dot-notation' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.mdx
'dot-notation': 'off',
'@typescript-eslint/dot-notation': 'off',

Expand Down Expand Up @@ -96,7 +96,7 @@ module.exports = {
'no-else-return': ['error', { allowElseIf: false }],

// Replace Airbnb 'no-empty-function' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.mdx
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': [
'error',
Expand Down Expand Up @@ -166,7 +166,7 @@ module.exports = {
'no-implicit-globals': 'off',

// Replace Airbnb 'no-implied-eval' and 'no-new-func' rules with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.mdx
'no-implied-eval': 'off',
'no-new-func': 'off',
'@typescript-eslint/no-implied-eval': 'off',
Expand All @@ -189,12 +189,12 @@ module.exports = {
'no-lone-blocks': 'error',

// Replace Airbnb 'no-loop-func' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.mdx
'no-loop-func': 'off',
'@typescript-eslint/no-loop-func': 'error',

// Replace Airbnb 'no-magic-numbers' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.mdx
'no-magic-numbers': 'off',
'@typescript-eslint/no-magic-numbers': [
'off',
Expand Down Expand Up @@ -231,6 +231,10 @@ module.exports = {
// https://eslint.org/docs/rules/no-nonoctal-decimal-escape
'no-nonoctal-decimal-escape': 'error',

// Disallow calls to the Object constructor without an argument
// https://eslint.org/docs/latest/rules/no-object-constructor
'no-object-constructor': 'off',

// disallow use of (old style) octal literals
// https://eslint.org/docs/rules/no-octal
'no-octal': 'error',
Expand Down Expand Up @@ -268,7 +272,7 @@ module.exports = {
'no-proto': 'error',

// Replace Airbnb 'no-redeclare' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.mdx
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',

Expand Down Expand Up @@ -331,7 +335,7 @@ module.exports = {
'no-return-assign': ['error', 'always'],

// Replace Airbnb 'no-return-await' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.mdx
'no-return-await': 'off',
'@typescript-eslint/return-await': 'off',

Expand All @@ -357,7 +361,7 @@ module.exports = {
'no-sequences': 'error',

// Replace Airbnb 'no-throw-literal' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.mdx
'no-throw-literal': 'off',
'@typescript-eslint/no-throw-literal': 'off',

Expand All @@ -366,7 +370,7 @@ module.exports = {
'no-unmodified-loop-condition': 'off',

// Replace Airbnb 'no-unused-expressions' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.mdx
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': [
'error',
Expand Down Expand Up @@ -441,7 +445,7 @@ module.exports = {
radix: 'error',

// Replace Airbnb 'require-await' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.mdx
'require-await': 'off',
'@typescript-eslint/require-await': 'off',

Expand Down
7 changes: 3 additions & 4 deletions rules/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module.exports = {

// Disallows expressions where the operation doesn't affect the value
// https://eslint.org/docs/rules/no-constant-binary-expression
// TODO: semver-major, enable
'no-constant-binary-expression': 'off',

// disallow use of constant expressions in conditions
Expand Down Expand Up @@ -67,7 +66,7 @@ module.exports = {
'no-extra-boolean-cast': 'error',

// Replace Airbnb 'no-extra-parens' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.mdx
'no-extra-parens': 'off',
'@typescript-eslint/no-extra-parens': [
'off',
Expand All @@ -82,7 +81,7 @@ module.exports = {
],

// Replace Airbnb 'no-extra-semi' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-semi.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-semi.mdx
'no-extra-semi': 'off',
'@typescript-eslint/no-extra-semi': 'error',

Expand All @@ -102,7 +101,7 @@ module.exports = {
'no-irregular-whitespace': 'error',

// Replace Airbnb 'no-loss-of-precision' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loss-of-precision.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loss-of-precision.mdx
'no-loss-of-precision': 'off',
'@typescript-eslint/no-loss-of-precision': 'error',

Expand Down
4 changes: 2 additions & 2 deletions rules/es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = {
'no-const-assign': 'error',

// Replace Airbnb 'no-dupe-class-members' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dupe-class-members.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dupe-class-members.mdx
'no-dupe-class-members': 'off',
'@typescript-eslint/no-dupe-class-members': 'error',

Expand Down Expand Up @@ -86,7 +86,7 @@ module.exports = {
'no-useless-computed-key': 'error',

// Replace Airbnb 'no-useless-constructor' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.mdx
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',

Expand Down
28 changes: 14 additions & 14 deletions rules/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
'block-spacing': ['error', 'always'],

// Replace Airbnb 'brace-style' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/brace-style.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/brace-style.mdx
'brace-style': 'off',
'@typescript-eslint/brace-style': [
'error',
Expand All @@ -25,7 +25,7 @@ module.exports = {
],

// Replace Airbnb 'camelcase' rule with '@typescript-eslint/naming-convention'
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.mdx
camelcase: 'off',
// The `@typescript-eslint/naming-convention` rule allows `leadingUnderscore` and `trailingUnderscore` settings. However, the existing `no-underscore-dangle` rule already takes care of this.
'@typescript-eslint/naming-convention': [
Expand Down Expand Up @@ -67,7 +67,7 @@ module.exports = {
],

// Replace Airbnb 'comma-dangle' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-dangle.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-dangle.mdx
// The TypeScript version also adds 3 new options, all of which should be set to the same value as the base config
'comma-dangle': 'off',
'@typescript-eslint/comma-dangle': [
Expand All @@ -85,7 +85,7 @@ module.exports = {
],

// Replace Airbnb 'comma-spacing' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-spacing.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-spacing.mdz
'comma-spacing': 'off',
'@typescript-eslint/comma-spacing': [
'error',
Expand Down Expand Up @@ -126,7 +126,7 @@ module.exports = {
'function-call-argument-newline': ['error', 'consistent'],

// Replace Airbnb 'func-call-spacing' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.mdx
'func-call-spacing': 'off',
'@typescript-eslint/func-call-spacing': ['error', 'never'],

Expand Down Expand Up @@ -170,7 +170,7 @@ module.exports = {
'implicit-arrow-linebreak': ['error', 'beside'],

// Replace Airbnb 'indent' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/indent.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/indent.mdx
indent: 'off',
'@typescript-eslint/indent': [
'error',
Expand Down Expand Up @@ -226,7 +226,7 @@ module.exports = {
'key-spacing': ['error', { beforeColon: false, afterColon: true }],

// Replace Airbnb 'keyword-spacing' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.mdx
'keyword-spacing': 'off',
'@typescript-eslint/keyword-spacing': [
'error',
Expand Down Expand Up @@ -257,7 +257,7 @@ module.exports = {
'linebreak-style': ['error', 'unix'],

// Replace Airbnb 'lines-between-class-members' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/lines-between-class-members.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/lines-between-class-members.mdx
'lines-between-class-members': 'off',
'@typescript-eslint/lines-between-class-members': [
'error',
Expand Down Expand Up @@ -381,7 +381,7 @@ module.exports = {
'newline-per-chained-call': ['error', { ignoreChainWithDepth: 4 }],

// Replace Airbnb 'no-array-constructor' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.mdx
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',

Expand Down Expand Up @@ -518,7 +518,7 @@ module.exports = {
'nonblock-statement-body-position': ['error', 'beside', { overrides: {} }],

// Replace Airbnb 'object-curly-spacing' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/object-curly-spacing.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/object-curly-spacing.mdx
'object-curly-spacing': 'off',
'@typescript-eslint/object-curly-spacing': ['error', 'always'],

Expand Down Expand Up @@ -613,7 +613,7 @@ module.exports = {
'require-jsdoc': 'off',

// Replace Airbnb 'semi' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.mdx
semi: 'off',
'@typescript-eslint/semi': ['error', 'always'],

Expand All @@ -631,12 +631,12 @@ module.exports = {
'sort-vars': 'off',

// Replace Airbnb 'space-before-blocks' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-blocks.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-blocks.mdx
'space-before-blocks': 'off',
'@typescript-eslint/space-before-blocks': 'error',

// Replace Airbnb 'space-before-function-paren' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-function-paren.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-function-paren.mdx
'space-before-function-paren': 'off',
'@typescript-eslint/space-before-function-paren': [
'error',
Expand All @@ -651,7 +651,7 @@ module.exports = {
'space-in-parens': ['error', 'never'],

// Replace Airbnb 'space-infix-ops' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-infix-ops.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-infix-ops.mdx
'space-infix-ops': 'off',
'@typescript-eslint/space-infix-ops': 'error',

Expand Down
6 changes: 3 additions & 3 deletions rules/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
),

// Replace Airbnb 'no-shadow' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.mdx
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',

Expand All @@ -54,15 +54,15 @@ module.exports = {
'no-undefined': 'off',

// Replace Airbnb 'no-unused-vars' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.mdx
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ vars: 'all', args: 'after-used', ignoreRestSiblings: true },
],

// Replace Airbnb 'no-use-before-define' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.mdx
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': [
'error',
Expand Down

0 comments on commit 2767b62

Please sign in to comment.