diff --git a/.vscode/settings.json b/.vscode/settings.json index f56c6dd3e89..5a0b1cd0524 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,5 @@ "files.associations": { "turbo.json": "jsonc" }, - "eslint.workingDirectories": ["packages/*", "tests/*"] + "eslint.workingDirectories": [{ "mode": "auto" }, "packages/*", "tests/*"] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000000..5c3f2f6d9cb --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,34 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "pnpm: lint", + "type": "shell", + "command": "pnpm lint", + + "problemMatcher": { + "owner": "pnpm-lint", + "fileLocation": ["absolute"], + "background": { + "activeOnStart": true, + "beginsPattern": "^Scope: .* workspace projects$", + "endsPattern": "^Summary: .* fails, .* passes$" + }, + "pattern": [ + { + "regexp": "^.+lint: (\\/.+)$", + "file": 1 + }, + { + "regexp": "^.+lint:\\s+(\\d+):(\\d+)\\s+(\\w+)\\s+(.+)$", + "line": 1, + "column": 2, + "severity": 3, + "message": 4, + "loop": true + } + ] + } + } + ] +} diff --git a/config/eslint/node.cjs b/config/eslint/node.cjs index 6210609092b..e61a7df5ec9 100644 --- a/config/eslint/node.cjs +++ b/config/eslint/node.cjs @@ -1,8 +1,6 @@ function defaults(config) { const result = { - files: !config?.useModules - ? ['./babel.config.js', './.eslintrc.cjs', './index.js', './addon-main.cjs', './addon-main.js'] - : [], + files: !config?.useModules ? ['./index.js', './addon-main.cjs', './addon-main.js'] : [], parserOptions: { sourceType: config?.useModules ? 'module' : 'script', ecmaVersion: 2022, @@ -24,6 +22,35 @@ function defaults(config) { return result; } +function config(config) { + const result = { + files: ['./babel.config.js', './.eslintrc.cjs', './rollup.config.mjs'], + parserOptions: { + sourceType: config?.useModules ? 'module' : 'script', + ecmaVersion: 2022, + }, + env: { + browser: false, + node: true, + es6: true, + }, + globals: config?.globals || {}, + plugins: ['n'], + extends: 'plugin:n/recommended', + rules: { + // It's ok to use unpublished files here since we don't ship these + 'n/no-unpublished-require': 'off', + }, + }; + + if (config?.files) { + result.files.push(...config.files); + } + + return result; +} + module.exports = { defaults, + config, }; diff --git a/package.json b/package.json index 392135d17bd..65dfbd9d112 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "prepare": "pnpm build", "build": "turbo _build --log-order=stream --filter=./packages/*", "build:docs": "mkdir -p packages/-ember-data/dist && cd ./docs-generator && node ./compile-docs.js", - "lint": "pnpm run -r --workspace-concurrency=-1 --if-present lint", + "lint": "FORCE_COLOR=2 pnpm run -r --workspace-concurrency=-1 --if-present --reporter=append-only --no-bail lint", "preinstall": "npx only-allow pnpm", "check:types": "pnpm run -r --workspace-concurrency=-1 --if-present check:types", "test": "pnpm turbo test --concurrency=1", @@ -139,4 +139,4 @@ "testem@3.10.1": "patches/testem@3.10.1.patch" } } -} \ No newline at end of file +} diff --git a/packages/-ember-data/.eslintrc.cjs b/packages/-ember-data/.eslintrc.cjs index e0b0ab38b64..ddef87ad22a 100644 --- a/packages/-ember-data/.eslintrc.cjs +++ b/packages/-ember-data/.eslintrc.cjs @@ -22,5 +22,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/-ember-data/package.json b/packages/-ember-data/package.json index 072730fd959..75ac2087754 100644 --- a/packages/-ember-data/package.json +++ b/packages/-ember-data/package.json @@ -12,7 +12,7 @@ "test": "tests" }, "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "move-dts": "bun ../../scripts/copy-declarations.mjs addon", "build:types": "tsc --build", "_build": "bun run build:types && bun run move-dts", diff --git a/packages/active-record/.eslintrc.cjs b/packages/active-record/.eslintrc.cjs index 440b732b749..dbf68cb61a9 100644 --- a/packages/active-record/.eslintrc.cjs +++ b/packages/active-record/.eslintrc.cjs @@ -22,5 +22,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/active-record/package.json b/packages/active-record/package.json index 6e06e881316..55dcda15410 100644 --- a/packages/active-record/package.json +++ b/packages/active-record/package.json @@ -70,7 +70,7 @@ } }, "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "_build": "bun run build:client && bun run build:types", diff --git a/packages/adapter/.eslintrc.cjs b/packages/adapter/.eslintrc.cjs index e3164c866f3..8b791b08b4b 100644 --- a/packages/adapter/.eslintrc.cjs +++ b/packages/adapter/.eslintrc.cjs @@ -30,5 +30,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/adapter/package.json b/packages/adapter/package.json index e9b8253add7..d7eb071ed5f 100644 --- a/packages/adapter/package.json +++ b/packages/adapter/package.json @@ -14,7 +14,7 @@ "author": "", "directories": {}, "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "_build": "bun run build:client && bun run build:types", diff --git a/packages/core-types/.eslintrc.cjs b/packages/core-types/.eslintrc.cjs index 94f092444d8..a34d3761938 100644 --- a/packages/core-types/.eslintrc.cjs +++ b/packages/core-types/.eslintrc.cjs @@ -22,5 +22,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/core-types/package.json b/packages/core-types/package.json index 911479017ac..fa432919e03 100644 --- a/packages/core-types/package.json +++ b/packages/core-types/package.json @@ -13,7 +13,7 @@ "license": "MIT", "author": "Chris Thoburn ", "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "_build": "bun run build:client && bun run build:types", diff --git a/packages/debug/.eslintrc.cjs b/packages/debug/.eslintrc.cjs index 21f62606654..2d4b679d7d3 100644 --- a/packages/debug/.eslintrc.cjs +++ b/packages/debug/.eslintrc.cjs @@ -21,5 +21,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults()], + overrides: [node.config(), node.defaults()], }; diff --git a/packages/debug/package.json b/packages/debug/package.json index c7fc33cd580..2b6b6a2fbc8 100644 --- a/packages/debug/package.json +++ b/packages/debug/package.json @@ -14,7 +14,7 @@ "author": "", "directories": {}, "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "peerDependencies": { diff --git a/packages/diagnostic/.eslintrc.cjs b/packages/diagnostic/.eslintrc.cjs index a94177fe64e..e0dfc8116cb 100644 --- a/packages/diagnostic/.eslintrc.cjs +++ b/packages/diagnostic/.eslintrc.cjs @@ -23,8 +23,13 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), overrides: [ + node.config(), node.defaults(), - node.defaults({ useModules: true, globals: { Bun: true }, files: ['./server/**'] }), + node.defaults({ + files: ['./server/**'], + useModules: true, + globals: { Bun: true }, + }), typescript.defaults({ rules: { 'no-console': 'off', diff --git a/packages/diagnostic/package.json b/packages/diagnostic/package.json index 7cfb0b62a14..d9e72f9c6bb 100644 --- a/packages/diagnostic/package.json +++ b/packages/diagnostic/package.json @@ -60,7 +60,7 @@ } }, "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:tests": "rm -rf dist-test && cp -R test dist-test && mkdir -p dist-test/@warp-drive && cp -R dist dist-test/@warp-drive/diagnostic", "build:types": "tsc --build", "build:runtime": "rollup --config", @@ -99,6 +99,7 @@ "@babel/preset-typescript": "^7.23.2", "@babel/runtime": "^7.23.2", "@embroider/addon-dev": "^4.1.1", + "@embroider/addon-shim": "^1.8.6", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-node-resolve": "^15.2.3", "@warp-drive/internal-config": "workspace:5.5.0-alpha.11", diff --git a/packages/diagnostic/server/browsers/index.js b/packages/diagnostic/server/browsers/index.js index a9226421ddf..8fc72d6c3df 100644 --- a/packages/diagnostic/server/browsers/index.js +++ b/packages/diagnostic/server/browsers/index.js @@ -2,8 +2,8 @@ import os from 'os'; import path from 'path'; import tmp from 'tmp'; -import { debug } from '../utils/debug'; -import { isWin, platformName } from '../utils/platform'; +import { debug } from '../utils/debug.js'; +import { isWin, platformName } from '../utils/platform.js'; export function getHomeDir() { return process.env.HOME || process.env.USERPROFILE; diff --git a/packages/diagnostic/server/bun/socket-handler.js b/packages/diagnostic/server/bun/socket-handler.js index 622bc6be353..cd50946707a 100644 --- a/packages/diagnostic/server/bun/socket-handler.js +++ b/packages/diagnostic/server/bun/socket-handler.js @@ -53,6 +53,11 @@ export function buildHandler(config, state) { await config.cleanup(); debug(`Configured cleanup hook completed`); } + // 1. We expect all cleanup to have happened after + // config.cleanup(), so exiting here should be safe. + // 2. We also want to forcibly exit with a success code in this + // case. + // eslint-disable-next-line n/no-process-exit process.exit(exitCode); } } diff --git a/packages/graph/.eslintrc.cjs b/packages/graph/.eslintrc.cjs index 94f092444d8..a34d3761938 100644 --- a/packages/graph/.eslintrc.cjs +++ b/packages/graph/.eslintrc.cjs @@ -22,5 +22,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/graph/package.json b/packages/graph/package.json index 7cef830913f..71a64bf06eb 100644 --- a/packages/graph/package.json +++ b/packages/graph/package.json @@ -13,7 +13,7 @@ "license": "MIT", "author": "Chris Thoburn ", "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "_build": "bun run build:client && bun run build:types", diff --git a/packages/holodeck/.eslintrc.cjs b/packages/holodeck/.eslintrc.cjs index 94f092444d8..a34d3761938 100644 --- a/packages/holodeck/.eslintrc.cjs +++ b/packages/holodeck/.eslintrc.cjs @@ -22,5 +22,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/json-api/.eslintrc.cjs b/packages/json-api/.eslintrc.cjs index 8cd33b93590..3b2f4e9906f 100644 --- a/packages/json-api/.eslintrc.cjs +++ b/packages/json-api/.eslintrc.cjs @@ -22,5 +22,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/json-api/package.json b/packages/json-api/package.json index b8c9094340d..d4b789e9c0e 100644 --- a/packages/json-api/package.json +++ b/packages/json-api/package.json @@ -13,7 +13,7 @@ "license": "MIT", "author": "", "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "_build": "bun run build:client && bun run build:types", diff --git a/packages/legacy-compat/.eslintrc.cjs b/packages/legacy-compat/.eslintrc.cjs index 909003a7295..b13a54eda67 100644 --- a/packages/legacy-compat/.eslintrc.cjs +++ b/packages/legacy-compat/.eslintrc.cjs @@ -23,7 +23,7 @@ const config = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; module.exports = config; diff --git a/packages/legacy-compat/package.json b/packages/legacy-compat/package.json index b9521bbf8a2..c840dfbc4c6 100644 --- a/packages/legacy-compat/package.json +++ b/packages/legacy-compat/package.json @@ -40,7 +40,7 @@ } }, "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "_build": "bun run build:client && bun run build:types", diff --git a/packages/model/.eslintrc.cjs b/packages/model/.eslintrc.cjs index a624261eda1..1f6adc8c87b 100644 --- a/packages/model/.eslintrc.cjs +++ b/packages/model/.eslintrc.cjs @@ -35,5 +35,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/model/package.json b/packages/model/package.json index 06911adabfb..799b00b77c6 100644 --- a/packages/model/package.json +++ b/packages/model/package.json @@ -14,7 +14,7 @@ "author": "", "directories": {}, "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "move-dts": "bun ../../scripts/copy-declarations.mjs src", "build:types": "tsc --build && bun run move-dts", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", diff --git a/packages/model/src/-private/legacy-relationships-support.ts b/packages/model/src/-private/legacy-relationships-support.ts index b28a621fccc..038ea88ed0d 100644 --- a/packages/model/src/-private/legacy-relationships-support.ts +++ b/packages/model/src/-private/legacy-relationships-support.ts @@ -667,7 +667,6 @@ function handleCompletedRelationshipRequest( // has never been accessed if (proxy && !isHasMany) { // @ts-expect-error unsure why this is not resolving the boolean but async belongsTo is weird - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (proxy.content && proxy.content.isDestroying) { (proxy as PromiseBelongsTo).set('content', null); } diff --git a/packages/model/src/-private/references/belongs-to.ts b/packages/model/src/-private/references/belongs-to.ts index 3fc65c2d093..7f88c970f0d 100644 --- a/packages/model/src/-private/references/belongs-to.ts +++ b/packages/model/src/-private/references/belongs-to.ts @@ -393,7 +393,6 @@ export default class BelongsToReference { const record = this.store.push(jsonApiDoc); if (DEBUG) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-call assertPolymorphicType( this.belongsToRelationship.identifier, this.belongsToRelationship.definition, diff --git a/packages/model/src/-private/references/has-many.ts b/packages/model/src/-private/references/has-many.ts index 1a82d617035..92826c26c26 100644 --- a/packages/model/src/-private/references/has-many.ts +++ b/packages/model/src/-private/references/has-many.ts @@ -422,7 +422,6 @@ export default class HasManyReference { const relationshipMeta = this.hasManyRelationship.definition; const identifier = this.hasManyRelationship.identifier; - // eslint-disable-next-line @typescript-eslint/no-unsafe-call assertPolymorphicType(identifier, relationshipMeta, recordIdentifierFor(record), store); } return recordIdentifierFor(record); diff --git a/packages/model/tsconfig.json b/packages/model/tsconfig.json index 1e61a4dd946..8fe85b9918a 100644 --- a/packages/model/tsconfig.json +++ b/packages/model/tsconfig.json @@ -1,7 +1,5 @@ { - "include": [ - "src/**/*", - ], + "include": ["src/**/*"], "baseUrl": ".", "compilerOptions": { "lib": ["DOM", "ESNext"], @@ -32,16 +30,14 @@ "emitDeclarationOnly": true, "inlineSourceMap": true, "inlineSources": true, - "types": [ - "ember-source/types", - ], + "types": ["ember-source/types"], "paths": { "@ember-data/deprecations": ["../private-build-infra/virtual-packages/deprecations.d.ts"], "@ember-data/packages": ["../private-build-infra/virtual-packages/packages.d.ts"], "@ember-data/canary-features": ["../private-build-infra/virtual-packages/canary-features.d.ts"], "@ember-data/debugging": ["../private-build-infra/virtual-packages/debugging.d.ts"], - "@ember-data/env": ["../private-build-infra/virtual-packages/env.d.ts"], + "@ember-data/env": ["../private-build-infra/virtual-packages/env.d.ts"] } }, "references": [ @@ -52,6 +48,6 @@ { "path": "../request-utils" }, { "path": "../store" }, { "path": "../tracking" }, - { "path": "../core-types" }, + { "path": "../core-types" } ] } diff --git a/packages/request-utils/.eslintrc.cjs b/packages/request-utils/.eslintrc.cjs index 94f092444d8..a34d3761938 100644 --- a/packages/request-utils/.eslintrc.cjs +++ b/packages/request-utils/.eslintrc.cjs @@ -22,5 +22,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/request-utils/package.json b/packages/request-utils/package.json index 4b0d122f2c4..07858b02bbb 100644 --- a/packages/request-utils/package.json +++ b/packages/request-utils/package.json @@ -44,7 +44,7 @@ } }, "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "_build": "bun run build:client && bun run build:types", diff --git a/packages/request/.eslintrc.cjs b/packages/request/.eslintrc.cjs index 94f092444d8..a34d3761938 100644 --- a/packages/request/.eslintrc.cjs +++ b/packages/request/.eslintrc.cjs @@ -22,5 +22,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/request/package.json b/packages/request/package.json index 016c12db9a3..f7e9bfb193b 100644 --- a/packages/request/package.json +++ b/packages/request/package.json @@ -15,7 +15,7 @@ "ember-addon" ], "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "_build": "bun run build:client && bun run build:types", diff --git a/packages/request/src/-private/utils.ts b/packages/request/src/-private/utils.ts index f1ae33e69d5..e498e2e883d 100644 --- a/packages/request/src/-private/utils.ts +++ b/packages/request/src/-private/utils.ts @@ -138,7 +138,6 @@ export function executeNextHandler( try { outcome = wares[i].request(context, next); if (DEBUG) { - // eslint-disable-next-line @typescript-eslint/no-misused-promises if (!outcome || (!(outcome instanceof Promise) && !(typeof outcome === 'object' && 'then' in outcome))) { // eslint-disable-next-line no-console console.log({ request, handler: wares[i], outcome }); diff --git a/packages/rest/.eslintrc.cjs b/packages/rest/.eslintrc.cjs index 440b732b749..dbf68cb61a9 100644 --- a/packages/rest/.eslintrc.cjs +++ b/packages/rest/.eslintrc.cjs @@ -22,5 +22,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/rest/package.json b/packages/rest/package.json index c4738650053..0a750e3e51a 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -48,7 +48,7 @@ } }, "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "_build": "bun run build:client && bun run build:types", diff --git a/packages/schema-record/.eslintrc.cjs b/packages/schema-record/.eslintrc.cjs index a7c9b24a636..4e88623f23e 100644 --- a/packages/schema-record/.eslintrc.cjs +++ b/packages/schema-record/.eslintrc.cjs @@ -22,5 +22,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/schema-record/package.json b/packages/schema-record/package.json index 0ea0fed7abd..ffdf8168a28 100644 --- a/packages/schema-record/package.json +++ b/packages/schema-record/package.json @@ -14,7 +14,7 @@ "license": "MIT", "author": "", "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:runtime": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "build:types": "tsc --build", "_build": "bun run build:runtime && bun run build:types", diff --git a/packages/serializer/.eslintrc.cjs b/packages/serializer/.eslintrc.cjs index 42992c36c96..bf7106fbe2a 100644 --- a/packages/serializer/.eslintrc.cjs +++ b/packages/serializer/.eslintrc.cjs @@ -30,5 +30,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/serializer/package.json b/packages/serializer/package.json index 9c95daee6dc..dcda67632bb 100644 --- a/packages/serializer/package.json +++ b/packages/serializer/package.json @@ -14,7 +14,7 @@ "author": "", "directories": {}, "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "_build": "bun run build:client && bun run build:types", diff --git a/packages/store/.eslintrc.cjs b/packages/store/.eslintrc.cjs index 4f4e31ba48d..24df7287ffe 100644 --- a/packages/store/.eslintrc.cjs +++ b/packages/store/.eslintrc.cjs @@ -22,5 +22,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/store/package.json b/packages/store/package.json index 87c75235cd1..65fab319c43 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -32,7 +32,7 @@ } }, "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:runtime": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "build:types": "tsc --build", "_build": "bun run build:runtime && bun run build:types", diff --git a/packages/store/src/-private/managers/record-array-manager.ts b/packages/store/src/-private/managers/record-array-manager.ts index 23fd430e6cc..f6fa804e954 100644 --- a/packages/store/src/-private/managers/record-array-manager.ts +++ b/packages/store/src/-private/managers/record-array-manager.ts @@ -343,7 +343,6 @@ class RecordArrayManager { this.clear(false); this._live.clear(); this.isDestroyed = true; - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument this.store.notifications.unsubscribe(this._subscription); } } diff --git a/packages/tracking/.eslintrc.cjs b/packages/tracking/.eslintrc.cjs index c31848a9c2c..08c92caa96c 100644 --- a/packages/tracking/.eslintrc.cjs +++ b/packages/tracking/.eslintrc.cjs @@ -27,5 +27,5 @@ module.exports = { ignorePatterns: ignore.ignoreRules(), - overrides: [node.defaults(), typescript.defaults()], + overrides: [node.config(), node.defaults(), typescript.defaults()], }; diff --git a/packages/tracking/package.json b/packages/tracking/package.json index 1ded198cf3f..a363a0f3f2f 100644 --- a/packages/tracking/package.json +++ b/packages/tracking/package.json @@ -53,7 +53,7 @@ } }, "scripts": { - "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives", "build:runtime": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "build:types": "tsc --build", "_build": "bun run build:runtime && bun run build:types", diff --git a/packages/tracking/src/-private.ts b/packages/tracking/src/-private.ts index f01f186c199..5ee02c07b28 100644 --- a/packages/tracking/src/-private.ts +++ b/packages/tracking/src/-private.ts @@ -320,9 +320,9 @@ export function createSignal(obj: T, key: string): Signal { if (DEBUG) { // @ts-expect-error - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-base-to-string + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const modelName = obj.modelName ?? obj.constructor?.modelName ?? ''; - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-base-to-string + // eslint-disable-next-line @typescript-eslint/no-base-to-string const className = obj.constructor?.name ?? obj.toString?.() ?? 'unknown'; _signal._debug_base = `${className}${modelName ? `:${modelName}` : ''}`; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3e6020556a3..7009b6843c4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -120,6 +120,12 @@ importers: eslint-config-prettier: specifier: ^9.0.0 version: 9.0.0(eslint@8.52.0) + eslint-import-resolver-esm: + specifier: ^1.0.8 + version: 1.0.8 + eslint-import-resolver-node: + specifier: ^0.3.9 + version: 0.3.9 eslint-plugin-import: specifier: ^2.29.0 version: 2.29.0(@typescript-eslint/parser@6.8.0)(eslint@8.52.0) @@ -676,6 +682,9 @@ importers: '@embroider/addon-dev': specifier: ^4.1.1 version: 4.1.1(rollup@4.1.4) + '@embroider/addon-shim': + specifier: ^1.8.6 + version: 1.8.6 '@glimmer/component': specifier: ^1.1.2 version: 1.1.2(@babel/core@7.23.2) @@ -11629,6 +11638,10 @@ packages: eslint: 8.52.0 dev: false + /eslint-import-resolver-esm@1.0.8: + resolution: {integrity: sha512-zER4jugyiAwV9ZAJCjKP5p5ypzh8wB0vDJ0M/cZIuN4BZlBdrymZYih22z7p0tneja2YblHCYV0TzRqaEn0JWw==} + dev: false + /eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} dependencies: