From 7346bde3f1e84eab0645543d0ecb37b0c22e48f7 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Thu, 16 Nov 2023 00:08:53 -0500 Subject: [PATCH] Slims lint rules & switches to bundler module res --- .eslintrc.base.json | 42 +++++++++++++++++++++++--------------- package.json | 1 + src/test/suite/system/trie.test.ts | 1 - src/webviews/apps/.eslintrc.json | 9 -------- tsconfig.base.json | 2 +- 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/.eslintrc.base.json b/.eslintrc.base.json index 5427199..8357774 100644 --- a/.eslintrc.base.json +++ b/.eslintrc.base.json @@ -5,7 +5,6 @@ "extends": [ "eslint:recommended", "plugin:@typescript-eslint/strict-type-checked", - "plugin:@typescript-eslint/stylistic-type-checked", "plugin:import/recommended", "plugin:import/typescript", "prettier" @@ -24,25 +23,17 @@ "root": true, "rules": { "anti-trojan-source/no-bidi": "error", - "arrow-parens": ["off"], - "brace-style": ["off", "stroustrup"], - "consistent-return": "off", - "curly": ["error", "multi-line", "consistent"], - "eol-last": "error", - "linebreak-style": ["error", "unix"], - "new-parens": "error", - "no-console": "off", "no-constant-condition": ["warn", { "checkLoops": false }], "no-constant-binary-expression": "error", "no-caller": "error", "no-debugger": "off", - "no-dupe-class-members": "off", "no-else-return": "warn", "no-empty": ["warn", { "allowEmptyCatch": true }], "no-eval": "error", "no-ex-assign": "warn", "no-extend-native": "error", "no-extra-bind": "error", + "no-extra-semi": "off", "no-floating-decimal": "error", "no-implicit-coercion": "error", "no-implied-eval": "error", @@ -50,7 +41,7 @@ "no-lone-blocks": "error", "no-lonely-if": "error", "no-loop-func": "error", - "no-multi-spaces": "error", + "no-mixed-spaces-and-tabs": "off", "no-restricted-globals": ["error", "process"], "no-restricted-imports": [ "error", @@ -98,8 +89,13 @@ "message": "Use @env/ instead" }, { - "group": ["src/**/*"], + "group": ["src/*"], "message": "Use relative paths instead" + }, + { + "group": ["react-dom"], + "importNames": ["Container"], + "message": "Use our Container instead" } ] } @@ -138,10 +134,7 @@ "prefer-rest-params": "error", "prefer-spread": "error", "prefer-template": "error", - "quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }], "require-atomic-updates": "off", - "semi": ["error", "always"], - "semi-style": ["error", "last"], "sort-imports": [ "error", { @@ -153,7 +146,7 @@ ], "yoda": "error", "import/consistent-type-specifier-style": ["error", "prefer-top-level"], - "import/extensions": ["error", "never"], + "import/extensions": "off", "import/newline-after-import": "warn", "import/no-absolute-path": "error", "import/no-cycle": "off", @@ -326,7 +319,22 @@ { "files": ["src/env/node/**/*"], "rules": { - "no-restricted-imports": "off" + "no-restricted-imports": [ + "error", + { + "patterns": [ + { + "group": ["src/*"], + "message": "Use relative paths instead" + }, + { + "group": ["react-dom"], + "importNames": ["Container"], + "message": "Use our Container instead" + } + ] + } + ] } } ] diff --git a/package.json b/package.json index 35b3547..3b90398 100644 --- a/package.json +++ b/package.json @@ -15739,6 +15739,7 @@ "patch-pre": "node ./scripts/applyPreReleasePatch.js", "prep-release": "node ./scripts/prep-release.js", "pretty": "prettier --config .prettierrc --log-level warn --write .", + "pretty:check": "prettier --config .prettierrc --check .", "pub": "vsce publish --yarn", "pub-pre": "vsce publish --yarn --pre-release", "rebuild": "yarn run reset && yarn run build", diff --git a/src/test/suite/system/trie.test.ts b/src/test/suite/system/trie.test.ts index 70867e0..73e95b9 100644 --- a/src/test/suite/system/trie.test.ts +++ b/src/test/suite/system/trie.test.ts @@ -5,7 +5,6 @@ import { isLinux } from '../../../env/node/platform'; import { normalizeRepoUri } from '../../../repositories'; import type { UriEntry } from '../../../system/trie'; import { PathEntryTrie, UriEntryTrie, UriTrie } from '../../../system/trie'; -// eslint-disable-next-line import/extensions import paths from './paths.json'; describe('PathEntryTrie Test Suite', () => { diff --git a/src/webviews/apps/.eslintrc.json b/src/webviews/apps/.eslintrc.json index b2ea94e..db4dddd 100644 --- a/src/webviews/apps/.eslintrc.json +++ b/src/webviews/apps/.eslintrc.json @@ -3,15 +3,6 @@ "env": { "browser": true }, - "rules": { - "import/extensions": [ - "error", - "never", - { - "js": "always" - } - ] - }, "parserOptions": { "project": "src/webviews/apps/tsconfig.json" }, diff --git a/tsconfig.base.json b/tsconfig.base.json index 4c5295e..31cd77e 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -8,7 +8,7 @@ "isolatedModules": true, "lib": ["es2022", "esnext.disposable"], "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "Bundler", "noFallthroughCasesInSwitch": true, "noImplicitOverride": true, "noImplicitReturns": true,