Skip to content

Commit 5a8ff33

Browse files
tylerbutleranthony-murphy-agent
authored andcommitted
fix(eslint): update import-x order config to use simple grouping (microsoft#25791)
This PR updates the @fluidframework/eslint-config-fluid package (v8.0.0 -> v8.1.0) with the following changes: ## Changes ### import-x/order rule simplified The `import-x/order` rule configuration has been simplified so that it enforces some ordering but doesn't require a lot of formatting changes in our source. Once we are fully migrated to Eslint 9 we can revisit the ordering we want. ### Resolver configuration updated The TypeScript resolver configuration has been updated to work correctly with the repository's build setup. ### no-hyphen-after-jsdoc-tag rule disabled The `@fluid-internal/fluid/no-hyphen-after-jsdoc-tag` rule has been temporarily disabled pending resolution of AB#29535.
1 parent b3057c2 commit 5a8ff33

File tree

10 files changed

+208
-863
lines changed

10 files changed

+208
-863
lines changed

common/build/eslint-config-fluid/CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
# @fluidframework/eslint-config-fluid Changelog
22

3-
## [8.0.0](https://github.com/microsoft/FluidFramework/releases/tag/eslint-config-fluid_v8.0_0)
3+
## [8.1.0](https://github.com/microsoft/FluidFramework/releases/tag/eslint-config-fluid_v8.1.0)
4+
5+
### import-x/order rule simplified
6+
7+
The `import-x/order` rule configuration has been simplified to use basic grouping without alphabetization or newlines-between settings. This provides more flexibility in import ordering while still maintaining consistent grouping of import types.
8+
9+
### Resolver configuration updated
10+
11+
The TypeScript resolver configuration has been updated to work correctly with the repository's build setup. The resolver no longer requires explicit name and options wrapping, and uses the resolver directly.
12+
13+
### no-hyphen-after-jsdoc-tag rule disabled
14+
15+
The `@fluid-internal/fluid/no-hyphen-after-jsdoc-tag` rule has been temporarily disabled pending resolution of ADO work item 29535.
16+
17+
## [8.0.0](https://github.com/microsoft/FluidFramework/releases/tag/eslint-config-fluid_v8.0.0)
418

519
### eslint-plugin-import replaced by eslint-plugin-import-x
620

common/build/eslint-config-fluid/base.js

Lines changed: 31 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* Licensed under the MIT License.
44
*/
55

6-
const tsResolver = require("eslint-import-resolver-typescript");
7-
86
/**
97
* Base configuration from which all of our exported configs extends.
108
*/
@@ -53,8 +51,9 @@ module.exports = {
5351

5452
/**
5553
* Disallow `-` immediately following a JSDoc/TSDoc tag (e.g. `@deprecated - foo`).
54+
* FIXME: https://dev.azure.com/fluidframework/internal/_workitems/edit/29535
5655
*/
57-
"@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": "error",
56+
"@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": "off",
5857

5958
/**
6059
* Disallow file path based links in JSDoc/TSDoc comments.
@@ -186,15 +185,8 @@ module.exports = {
186185
"import-x/order": [
187186
"error",
188187
{
189-
"newlines-between": "always",
190-
"alphabetize": {
191-
order: "asc",
192-
// Sorting is case-sensitive by default, which is the same as Biome. To avoid
193-
// another huge set of changes to order things case-insensitively, we'll just
194-
// use the rule with this config for now. This decision should be considered
195-
// pragmatic and not a statement of preference, and we should revisit this.
196-
caseInsensitive: false,
197-
},
188+
"newlines-between": "ignore",
189+
"groups": [["builtin", "external", "internal", "parent", "sibling", "index"]],
198190
},
199191
],
200192

@@ -370,6 +362,7 @@ module.exports = {
370362
files: ["**/types/*validate*Previous*.ts"],
371363
rules: {
372364
"@typescript-eslint/comma-spacing": "off",
365+
"import-x/order": "off",
373366
},
374367
},
375368
],
@@ -379,40 +372,36 @@ module.exports = {
379372
"@typescript-eslint/parser": [".ts", ".tsx", ".d.ts", ".cts", ".mts"],
380373
},
381374
"import-x/resolver": {
382-
name: "tsResolver",
383-
options: {
384-
typescript: {
385-
extensions: [
386-
// `.mts`, `.cts`, `.d.mts`, `.d.cts`, `.mjs`, `.cjs` are not included because `.cjs` and `.mjs` must be used
387-
// explicitly in imports
388-
".ts",
389-
".tsx",
390-
".d.ts",
391-
".js",
392-
".jsx",
393-
],
394-
conditionNames: [
395-
// This supports the test-only conditional export pattern used in merge-tree and id-compressor.
396-
"allow-ff-test-exports",
375+
typescript: {
376+
extensions: [
377+
// `.mts`, `.cts`, `.d.mts`, `.d.cts`, `.mjs`, `.cjs` are not included because `.cjs` and `.mjs` must be used
378+
// explicitly in imports
379+
".ts",
380+
".tsx",
381+
".d.ts",
382+
".js",
383+
".jsx",
384+
],
385+
conditionNames: [
386+
// This supports the test-only conditional export pattern used in merge-tree and id-compressor.
387+
"allow-ff-test-exports",
397388

398-
// Default condition names below, see https://github.com/import-js/eslint-import-resolver-typescript#conditionnames
399-
"types",
400-
"import",
389+
// Default condition names below, see https://github.com/import-js/eslint-import-resolver-typescript#conditionnames
390+
"types",
391+
"import",
401392

402-
// APF: https://angular.io/guide/angular-package-format
403-
"esm2020",
404-
"es2020",
405-
"es2015",
393+
// APF: https://angular.io/guide/angular-package-format
394+
"esm2020",
395+
"es2020",
396+
"es2015",
406397

407-
"require",
408-
"node",
409-
"node-addons",
410-
"browser",
411-
"default",
412-
],
413-
},
398+
"require",
399+
"node",
400+
"node-addons",
401+
"browser",
402+
"default",
403+
],
414404
},
415-
resolver: tsResolver, // required
416405
},
417406
},
418407
};

common/build/eslint-config-fluid/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fluidframework/eslint-config-fluid",
3-
"version": "8.0.0",
3+
"version": "8.1.0",
44
"description": "Shareable ESLint config for the Fluid Framework",
55
"homepage": "https://fluidframework.com",
66
"repository": {

common/build/eslint-config-fluid/printed-configs/default.json

Lines changed: 23 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"error"
4646
],
4747
"@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": [
48-
"error"
48+
"off"
4949
],
5050
"@fluid-internal/fluid/no-markdown-links-in-jsdoc": [
5151
"error"
@@ -1217,12 +1217,17 @@
12171217
"import-x/order": [
12181218
"error",
12191219
{
1220-
"newlines-between": "always",
1221-
"alphabetize": {
1222-
"order": "asc",
1223-
"caseInsensitive": false,
1224-
"orderImportKind": "ignore"
1225-
},
1220+
"newlines-between": "ignore",
1221+
"groups": [
1222+
[
1223+
"builtin",
1224+
"external",
1225+
"internal",
1226+
"parent",
1227+
"sibling",
1228+
"index"
1229+
]
1230+
],
12261231
"distinctGroup": true,
12271232
"sortTypesGroup": false,
12281233
"named": false,
@@ -2340,49 +2345,16 @@
23402345
]
23412346
},
23422347
"import-x/resolver": {
2343-
"name": "tsResolver",
2344-
"options": {
2345-
"typescript": {
2346-
"extensions": [
2347-
".ts",
2348-
".tsx",
2349-
".d.ts",
2350-
".js",
2351-
".jsx"
2352-
],
2353-
"conditionNames": [
2354-
"allow-ff-test-exports",
2355-
"types",
2356-
"import",
2357-
"esm2020",
2358-
"es2020",
2359-
"es2015",
2360-
"require",
2361-
"node",
2362-
"node-addons",
2363-
"browser",
2364-
"default"
2365-
]
2366-
}
2367-
},
2368-
"resolver": {
2369-
"DEFAULT_CONFIGS": [
2370-
"tsconfig.json",
2371-
"jsconfig.json"
2372-
],
2373-
"DEFAULT_IGNORE": "**/node_modules/**",
2374-
"DEFAULT_JSCONFIG": "jsconfig.json",
2375-
"DEFAULT_TRY_PATHS": [
2376-
"",
2377-
"tsconfig.json",
2378-
"jsconfig.json"
2348+
"typescript": {
2349+
"extensions": [
2350+
".ts",
2351+
".tsx",
2352+
".d.ts",
2353+
".js",
2354+
".jsx"
23792355
],
2380-
"DEFAULT_TSCONFIG": "tsconfig.json",
2381-
"IMPORT_RESOLVER_NAME": "eslint-import-resolver-typescript",
2382-
"JS_EXT_PATTERN": {},
2383-
"MATCH_ALL": "**",
2384-
"TSCONFIG_NOT_FOUND_REGEXP": {},
2385-
"defaultConditionNames": [
2356+
"conditionNames": [
2357+
"allow-ff-test-exports",
23862358
"types",
23872359
"import",
23882360
"esm2020",
@@ -2393,74 +2365,8 @@
23932365
"node-addons",
23942366
"browser",
23952367
"default"
2396-
],
2397-
"defaultExtensionAlias": {
2398-
".js": [
2399-
".ts",
2400-
".tsx",
2401-
".d.ts",
2402-
".js"
2403-
],
2404-
".ts": [
2405-
".ts",
2406-
".d.ts",
2407-
".js"
2408-
],
2409-
".jsx": [
2410-
".tsx",
2411-
".d.ts",
2412-
".jsx"
2413-
],
2414-
".tsx": [
2415-
".tsx",
2416-
".d.ts",
2417-
".jsx",
2418-
".js"
2419-
],
2420-
".cjs": [
2421-
".cts",
2422-
".d.cts",
2423-
".cjs"
2424-
],
2425-
".cts": [
2426-
".cts",
2427-
".d.cts",
2428-
".cjs"
2429-
],
2430-
".mjs": [
2431-
".mts",
2432-
".d.mts",
2433-
".mjs"
2434-
],
2435-
".mts": [
2436-
".mts",
2437-
".d.mts",
2438-
".mjs"
2439-
]
2440-
},
2441-
"defaultExtensions": [
2442-
".ts",
2443-
".tsx",
2444-
".d.ts",
2445-
".js",
2446-
".jsx",
2447-
".json",
2448-
".node"
2449-
],
2450-
"defaultMainFields": [
2451-
"types",
2452-
"typings",
2453-
"fesm2020",
2454-
"fesm2015",
2455-
"esm2020",
2456-
"es2020",
2457-
"module",
2458-
"jsnext:main",
2459-
"main"
2460-
],
2461-
"interfaceVersion": 2
2462-
},
2463-
"typescript": true
2368+
]
2369+
}
24642370
},
24652371
"jsdoc": {
24662372
"mode": "typescript",

0 commit comments

Comments
 (0)