From e5d6fe0bd4bc7b3e38f3faa8900b60866cce3db4 Mon Sep 17 00:00:00 2001 From: ChiefORZ Date: Tue, 20 Jun 2023 16:54:20 +0700 Subject: [PATCH] feat: add sort-keys-fix to tslint-config-base --- packages/base/lib/tslint-config.js | 99 ++++++++++++++++-------------- packages/base/package.json | 1 + pnpm-lock.yaml | 3 + 3 files changed, 56 insertions(+), 47 deletions(-) diff --git a/packages/base/lib/tslint-config.js b/packages/base/lib/tslint-config.js index fa01d07..88fd424 100644 --- a/packages/base/lib/tslint-config.js +++ b/packages/base/lib/tslint-config.js @@ -1,64 +1,69 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint', 'simple-import-sort', 'import'], + parser: "@typescript-eslint/parser", + plugins: [ + "@typescript-eslint", + "simple-import-sort", + "sort-keys-fix", + "import", + ], env: { node: true, es6: true, }, - ignorePatterns: ['.eslintrc.js'], - extends: ['eslint:recommended', 'plugin:eslint-comments/recommended'], + ignorePatterns: [".eslintrc.js"], + extends: ["eslint:recommended", "plugin:eslint-comments/recommended"], parserOptions: { ecmaVersion: 2020, - sourceType: 'module', - project: ['./tsconfig.json'], + sourceType: "module", + project: ["./tsconfig.json"], // debugLevel: true, }, overrides: [ { - files: ['*.ts'], + files: ["*.ts"], extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/eslint-recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:@typescript-eslint/recommended-requiring-type-checking', - 'plugin:prettier/recommended' + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:prettier/recommended", ], rules: { - '@typescript-eslint/ban-ts-comment': 'off', - '@typescript-eslint/ban-types': 'off', - '@typescript-eslint/consistent-type-imports': 'error', - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/no-empty-interface': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-misused-promises': 'off', - '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-unnecessary-type-assertion': 'off', - '@typescript-eslint/no-unsafe-argument': 'warn', - '@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-use-before-define': 'off', - '@typescript-eslint/no-var-requires': 'off', - '@typescript-eslint/restrict-plus-operands': 'off', - '@typescript-eslint/restrict-template-expressions': 'off', - 'eslint-comments/disable-enable-pair': 'error', - 'eslint-comments/no-aggregating-enable': 'error', - 'eslint-comments/no-duplicate-disable': 'error', - 'eslint-comments/no-unlimited-disable': 'error', - 'eslint-comments/no-unused-disable': 'error', - 'eslint-comments/no-unused-enable': 'error', - 'import/first': 'error', - 'import/newline-after-import': 'error', - 'import/no-duplicates': 'error', - 'no-empty': 'off', - 'no-useless-escape': 'off', - 'prettier/prettier': 'warn', - 'simple-import-sort/exports': 'error', - 'simple-import-sort/imports': 'error' + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/consistent-type-imports": "error", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-empty-interface": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-misused-promises": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unnecessary-type-assertion": "off", + "@typescript-eslint/no-unsafe-argument": "warn", + "@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-use-before-define": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/restrict-plus-operands": "off", + "@typescript-eslint/restrict-template-expressions": "off", + "eslint-comments/disable-enable-pair": "error", + "eslint-comments/no-aggregating-enable": "error", + "eslint-comments/no-duplicate-disable": "error", + "eslint-comments/no-unlimited-disable": "error", + "eslint-comments/no-unused-disable": "error", + "eslint-comments/no-unused-enable": "error", + "import/first": "error", + "import/newline-after-import": "error", + "import/no-duplicates": "error", + "no-empty": "off", + "no-useless-escape": "off", + "prettier/prettier": "warn", + "simple-import-sort/exports": "error", + "simple-import-sort/imports": "error", }, }, - ] -} \ No newline at end of file + ], +}; diff --git a/packages/base/package.json b/packages/base/package.json index ca0057e..cadac76 100644 --- a/packages/base/package.json +++ b/packages/base/package.json @@ -29,6 +29,7 @@ "eslint-plugin-import": "^2.26.0", "eslint-plugin-prefer-arrow": "^1.2.3", "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-sort-keys-fix": "^1.1.2", "eslint-plugin-simple-import-sort": "^10.0.0", "prettier": "^2.7.1", "typescript": "^5.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3eab43e..8bfa99b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -62,6 +62,9 @@ importers: eslint-plugin-simple-import-sort: specifier: ^10.0.0 version: 10.0.0(eslint@8.36.0) + eslint-plugin-sort-keys-fix: + specifier: ^1.1.2 + version: 1.1.2 prettier: specifier: ^2.7.1 version: 2.8.8