Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ESLint for VSCode #9055

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"files.associations": {
"turbo.json": "jsonc"
}
}
},
"eslint.workingDirectories": ["packages/*", "tests/*"]
}
26 changes: 19 additions & 7 deletions config/eslint/base.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
const path = require('path');
const prettierPath = path.join(process.cwd(), '../../.prettierrc.js');

let isRoot = false;
try {
const dir = process.cwd();
const pkg = require(path.join(dir, './package.json'));
if (pkg.name === 'root') {
isRoot = true;
}
} catch (e) {
console.log(e);
}

const prettierPath = path.join(process.cwd(), isRoot ? './.prettierrc.js' : '../../.prettierrc.js');
const prettierConfig = require(prettierPath);

function rules() {
Expand All @@ -20,13 +32,13 @@ function rules() {
'prefer-rest-params': 'off',
'prefer-const': 'error',

"prettier/prettier": [
"error",
'prettier/prettier': [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: We currently don't lint for prettier (or anything AFAICT) in this part of the project. Should we?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably. I want to separate prettier out like we did in AB frontend, but haven't had a chance to. Would handle this.

'error',
prettierConfig,
{
"usePrettierrc": false
}
]
usePrettierrc: false,
},
],
};
}

Expand All @@ -46,7 +58,7 @@ function settings() {
node: false,
es2022: true,
},
}
};
}

module.exports = {
Expand Down
1 change: 0 additions & 1 deletion config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"pnpm-sync-dependencies-meta-injected": "0.0.10",
"prettier": "^3.0.3",
"typescript": "~5.2.2"
},
Expand Down
3 changes: 0 additions & 3 deletions packages/active-record/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
"@ember/string": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
},
"@warp-drive/core-types": {
"injected": true
},
Expand Down
3 changes: 0 additions & 3 deletions packages/adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
"@ember/string": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
},
"@warp-drive/core-types": {
"injected": true
},
Expand Down
3 changes: 0 additions & 3 deletions packages/core-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
"dependenciesMeta": {
"@ember-data/private-build-infra": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
}
},
"devDependencies": {
Expand Down
3 changes: 0 additions & 3 deletions packages/debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
"@ember-data/store": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
},
"@ember-data/request": {
"injected": true
},
Expand Down
6 changes: 1 addition & 5 deletions packages/diagnostic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,5 @@
"ember": {
"edition": "octane"
},
"dependenciesMeta": {
"@warp-drive/internal-config": {
"injected": true
}
}
"dependenciesMeta": {}
}
3 changes: 0 additions & 3 deletions packages/graph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@
"@warp-drive/core-types": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
},
"@ember-data/request": {
"injected": true
},
Expand Down
3 changes: 0 additions & 3 deletions packages/holodeck/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@
"@ember-data/request": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
},
"@warp-drive/core-types": {
"injected": true
}
Expand Down
3 changes: 0 additions & 3 deletions packages/json-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@
"@ember-data/private-build-infra": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
},
"@warp-drive/core-types": {
"injected": true
},
Expand Down
3 changes: 0 additions & 3 deletions packages/legacy-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@
"@ember-data/json-api": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
},
"@ember-data/store": {
"injected": true
},
Expand Down
3 changes: 0 additions & 3 deletions packages/model/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@
"@ember-data/private-build-infra": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
},
"@ember-data/store": {
"injected": true
},
Expand Down
3 changes: 0 additions & 3 deletions packages/request-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@
"dependenciesMeta": {
"@warp-drive/core-types": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
}
}
}
3 changes: 0 additions & 3 deletions packages/request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@
},
"@warp-drive/core-types": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
}
},
"devDependencies": {
Expand Down
3 changes: 0 additions & 3 deletions packages/rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@
"edition": "octane"
},
"dependenciesMeta": {
"@warp-drive/internal-config": {
"injected": true
},
"@warp-drive/core-types": {
"injected": true
},
Expand Down
3 changes: 0 additions & 3 deletions packages/serializer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@
"@ember-data/private-build-infra": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
},
"@warp-drive/core-types": {
"injected": true
},
Expand Down
3 changes: 0 additions & 3 deletions packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@
"@warp-drive/core-types": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
},
"@ember/string": {
"injected": true
}
Expand Down
3 changes: 0 additions & 3 deletions packages/tracking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
"dependenciesMeta": {
"@ember-data/private-build-infra": {
"injected": true
},
"@warp-drive/internal-config": {
"injected": true
}
},
"dependencies": {
Expand Down
Loading
Loading