Skip to content

Commit

Permalink
Fix ESLint for VSCode (#9055)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Thoburn <runspired@gmail.com>
  • Loading branch information
gitKrystan and runspired authored Oct 25, 2023
1 parent 2ca4a57 commit fb5b968
Show file tree
Hide file tree
Showing 21 changed files with 151 additions and 150 deletions.
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': [
'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

0 comments on commit fb5b968

Please sign in to comment.