From 43178144feacc1bf262b1cbe8fdae6e759a80bbb Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:35:52 -0700 Subject: [PATCH 1/2] Sort imports with dprint instead of eslint --- .dprint.jsonc | 12 ++++++------ .eslintrc.json | 17 ++--------------- .vscode/settings.template.json | 2 +- package-lock.json | 17 ----------------- package.json | 1 - 5 files changed, 9 insertions(+), 40 deletions(-) diff --git a/.dprint.jsonc b/.dprint.jsonc index 35ce92c54f403..945a51ab237e9 100644 --- a/.dprint.jsonc +++ b/.dprint.jsonc @@ -23,11 +23,10 @@ "constructorType.spaceAfterNewKeyword": true, "constructSignature.spaceAfterNewKeyword": true, - // Let eslint-plugin-simple-import-sort handle this. - "module.sortImportDeclarations": "maintain", - "module.sortExportDeclarations": "maintain", - "exportDeclaration.sortNamedExports": "maintain", - "importDeclaration.sortNamedImports": "maintain" + "module.sortImportDeclarations": "caseInsensitive", + "module.sortExportDeclarations": "caseInsensitive", + "exportDeclaration.sortNamedExports": "caseInsensitive", + "importDeclaration.sortNamedImports": "caseInsensitive" }, "prettier": { "newLineKind": "lf", @@ -53,7 +52,8 @@ "tests/**", "internal/**", "**/*.generated.*", - "scripts/*.d.*" + "scripts/*.d.*", + "**/_namespaces/**" ], // Note: if adding new languages, make sure settings.template.json is updated too. "plugins": [ diff --git a/.eslintrc.json b/.eslintrc.json index 1fdedf0965a9f..dcdfe27afff51 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,8 +18,7 @@ "plugins": [ "@typescript-eslint", "no-null", - "eslint-plugin-local", - "simple-import-sort" + "eslint-plugin-local" ], "ignorePatterns": [ "**/node_modules/**", @@ -136,11 +135,7 @@ "local/jsdoc-format": "error", // eslint-plugin-no-null - "no-null/no-null": "error", - - // eslint-plugin-simple-import-sort - "simple-import-sort/imports": "error", - "simple-import-sort/exports": "error" + "no-null/no-null": "error" }, "overrides": [ // By default, the ESLint CLI only looks at .js files. But, it will also look at @@ -167,14 +162,6 @@ { "name": "exports" } ] } - }, - { - // These files contain imports in a specific order that are generally unsafe to modify. - "files": ["**/_namespaces/**"], - "rules": { - "simple-import-sort/imports": "off", - "simple-import-sort/exports": "off" - } } ] } diff --git a/.vscode/settings.template.json b/.vscode/settings.template.json index bdc064f89485e..25750e2f17490 100644 --- a/.vscode/settings.template.json +++ b/.vscode/settings.template.json @@ -18,7 +18,7 @@ ".git-blame-ignore-revs" ], - // Match eslint-plugin-simple-import-sort in organize/auto-imports. + // Match dprint in organize/auto-imports. "typescript.unstable": { "organizeImportsCollation": "unicode", "organizeImportsCaseFirst": "upper", diff --git a/package-lock.json b/package-lock.json index 75d996fd5a0fe..e36d26ed3fe72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,6 @@ "eslint-formatter-autolinkable-stylish": "^1.3.0", "eslint-plugin-local": "^4.2.1", "eslint-plugin-no-null": "^1.0.2", - "eslint-plugin-simple-import-sort": "^12.0.0", "fast-xml-parser": "^4.3.6", "glob": "^10.3.10", "hereby": "^1.8.9", @@ -2100,15 +2099,6 @@ "eslint": ">=3.0.0" } }, - "node_modules/eslint-plugin-simple-import-sort": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.0.0.tgz", - "integrity": "sha512-8o0dVEdAkYap0Cn5kNeklaKcT1nUsa3LITWEuFk3nJifOoD+5JQGoyDUW2W/iPWwBsNBJpyJS9y4je/BgxLcyQ==", - "dev": true, - "peerDependencies": { - "eslint": ">=5.0.0" - } - }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", @@ -5905,13 +5895,6 @@ "dev": true, "requires": {} }, - "eslint-plugin-simple-import-sort": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.0.0.tgz", - "integrity": "sha512-8o0dVEdAkYap0Cn5kNeklaKcT1nUsa3LITWEuFk3nJifOoD+5JQGoyDUW2W/iPWwBsNBJpyJS9y4je/BgxLcyQ==", - "dev": true, - "requires": {} - }, "eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", diff --git a/package.json b/package.json index b0cb8218a2a89..16ea88d56ab01 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,6 @@ "eslint-formatter-autolinkable-stylish": "^1.3.0", "eslint-plugin-local": "^4.2.1", "eslint-plugin-no-null": "^1.0.2", - "eslint-plugin-simple-import-sort": "^12.0.0", "fast-xml-parser": "^4.3.6", "glob": "^10.3.10", "hereby": "^1.8.9", From 494235fda5cb910bab33572151f4d02757138c0b Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 3 Apr 2024 10:06:41 -0700 Subject: [PATCH 2/2] Update settings template to match dprint --- .vscode/settings.template.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.template.json b/.vscode/settings.template.json index 25750e2f17490..e918fd9577867 100644 --- a/.vscode/settings.template.json +++ b/.vscode/settings.template.json @@ -23,13 +23,15 @@ "organizeImportsCollation": "unicode", "organizeImportsCaseFirst": "upper", "organizeImportsIgnoreCase": false, - "organizeImportsNumericCollation": true + "organizeImportsNumericCollation": true, + "organizeImportsTypeOrder": "inline" }, "javascript.unstable": { "organizeImportsCollation": "unicode", "organizeImportsCaseFirst": "upper", "organizeImportsIgnoreCase": false, - "organizeImportsNumericCollation": true + "organizeImportsNumericCollation": true, + "organizeImportsTypeOrder": "inline" }, // These options search the repo recursively and slow down