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

Update lints ahead of #1462, so that #1462's diff is smaller #1474

Merged
merged 7 commits into from
Oct 29, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: wyvox/action-setup-pnpm@v2
with:
node-version: 20.1.0

lint:
name: Linting
Expand All @@ -29,6 +31,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: wyvox/action-setup-pnpm@v2
with:
node-version: 20.1.0
- run: pnpm lint

test-chrome:
Expand All @@ -50,6 +54,8 @@ jobs:
xdg-utils wget libcairo2
- uses: actions/checkout@v3
- uses: wyvox/action-setup-pnpm@v2
with:
node-version: 20.1.0
- run: pnpm test

# test-browserstack:
Expand Down Expand Up @@ -97,6 +103,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: wyvox/action-setup-pnpm@v2
with:
node-version: 20.1.0
- run: pnpm build
- run: pnpm test:types

Expand All @@ -111,4 +119,5 @@ jobs:
- uses: wyvox/action-setup-pnpm@v2
with:
args: '--no-lockfile'
node-version: 20.1.0
- run: pnpm test
3 changes: 2 additions & 1 deletion benchmark/benchmarks/krausest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@glimmer/compiler": "workspace:^"
},
"devDependencies": {
"eslint": "^8.52.0",
"vite": "^4.3.9",
"@types/node": "^18.16.7"
},
Expand All @@ -23,4 +24,4 @@
"test:lint": "eslint .",
"test:types": "tsc --noEmit -p ../../tsconfig.json"
}
}
}
3 changes: 2 additions & 1 deletion bin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@types/puppeteer-chromium-resolver": "workspace:^"
},
"devDependencies": {
"eslint": "^8.52.0",
"esno": "^0.16.3"
},
"engines": {
Expand All @@ -25,4 +26,4 @@
"test:lint": "eslint .",
"test:types": "tsc --noEmit -p ./tsconfig.json"
}
}
}
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build:control": "rollup -c rollup.config.mjs",
"build:flags": "RETAIN_FLAGS=true ember build --env production --suppress-sizes",
"lint": "npm-run-all lint:*",
"lint:files": "dotenv -- turbo lint",
"lint:files": "dotenv -- turbo test:lint",
"force:lint:files": "eslint .",
"lint:types": "tsc -b",
"start": "ember serve --port=7357",
Expand Down Expand Up @@ -68,12 +68,12 @@
"@types/babel-plugin-macros": "^3.1.0",
"@types/babel__core": "^7.20.0",
"@types/babel__traverse": "^7.18.5",
"@types/eslint": "^8.37.0",
"@types/eslint": "^8.44.6",
"@types/node": "^18.16.6",
"@types/preval.macro": "^3.0.0",
"@types/qunit": "^2.19.7",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"amd-name-resolver": "^1.3.1",
"auto-dist-tag": "^2.1.1",
"babel-plugin-macros": "^3.1.0",
Expand All @@ -84,14 +84,14 @@
"ember-cli": "~4.12.1",
"ember-cli-browserstack": "^2.0.1",
"ensure-posix-path": "^1.1.1",
"eslint": "^8.40.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-qunit": "^7.3.4",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-n": "^16.2.0",
"eslint-plugin-qunit": "^8.0.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"eslint-plugin-unused-imports": "^3.0.0",
"execa": "^7.1.1",
"fast-glob": "^3.2.12",
"glob": "^10.2.3",
Expand Down
38 changes: 38 additions & 0 deletions packages/@glimmer-workspace/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,43 @@ module.exports = {
'@typescript-eslint/unbound-method': 'off',
},
},
//////////////////////////////////////////////////////////
// Remove when https://github.com/glimmerjs/glimmer-vm/pull/1462
// is merged.
//////////////////////////////////////////////////////////
{
files: [
'integration-tests/lib/dom/assertions.ts',
'integration-tests/lib/dom/simple-utils.ts',
'integration-tests/lib/modes/rehydration/builder.ts',
'integration-tests/lib/snapshot.ts',
],
rules: {
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
},
},
{
files: [
'integration-tests/test/updating-test.ts',
'integration-tests/lib/dom/simple-utils.ts',
'integration-tests/lib/modes/jit/delegate.ts',
'integration-tests/lib/modes/jit/register.ts',
'integration-tests/lib/render-delegate.ts',
'integration-tests/test/style-warnings-test.ts',
'integration-tests/test/updating-content-matrix-test.ts',
],
rules: {
'@typescript-eslint/no-redundant-type-constituents': 'off',
},
},
{
files: [
'integration-tests/test/ember-component-test.ts',
'integration-tests/lib/render-test.ts',
],
rules: {
'@typescript-eslint/no-base-to-string': 'off',
},
},
],
};
5 changes: 4 additions & 1 deletion packages/@glimmer-workspace/benchmark-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
"@glimmer/util": "workspace:^",
"@glimmer/validator": "workspace:^"
},
"devDependencies": {
"eslint": "^8.52.0"
},
"scripts": {
"test:lint": "eslint .",
"test:types": "tsc --noEmit -p ../tsconfig.json"
}
}
}
9 changes: 5 additions & 4 deletions packages/@glimmer-workspace/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"dependencies": {
"@rollup/plugin-commonjs": "^24.1.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"eslint": "^8.40.0",
"eslint-plugin-import": "^2.27.5",
"eslint": "^8.52.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"eslint-plugin-unused-imports": "^3.0.0",
"magic-string": "^0.30.0",
"postcss": "^8.4.31",
"rollup": "^3.21.6",
Expand All @@ -38,6 +38,7 @@
"vite": "4.3.9"
},
"devDependencies": {
"eslint": "^8.52.0",
"@types/node": "^18.16.6",
"typescript": "*"
}
Expand Down
9 changes: 9 additions & 0 deletions packages/@glimmer-workspace/eslint-plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ module.exports = {
'prettier',
],
rules: {
'no-restricted-imports': 'off',
'@typescript-eslint/no-restricted-imports': [
'error',
{
patterns: [
{ group: ['**/generated/**'], message: "Don't import directly from generated files" },
],
},
],
'no-console': 'error',
'no-debugger': 'error',
'no-loop-func': 'error',
Expand Down
25 changes: 13 additions & 12 deletions packages/@glimmer-workspace/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
"private": true,
"main": "index.js",
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-qunit": "^7.3.4",
"eslint-plugin-regexp": "^1.15.0",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-deprecation": "^2.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-n": "^16.2.0",
"eslint-plugin-qunit": "^8.0.1",
"eslint-plugin-regexp": "^2.1.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^2.0.0"
"eslint-plugin-unused-imports": "^3.0.0"
},
"peerDependencies": {
"eslint": "^8.40.0"
"eslint": "^8.47.0"
},
"devDependencies": {
"@types/eslint": "^8.37.0",
"eslint": "^8.40.0"
"@types/eslint": "^8.44.6",
"eslint": "^8.52.0"
}
}
1 change: 1 addition & 0 deletions packages/@glimmer-workspace/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"js-reporters": "^2.1.0"
},
"devDependencies": {
"eslint": "^8.52.0",
"@glimmer/local-debug-flags": "workspace:^",
"@types/qunit": "^2.19.7",
"@types/js-reporters": "workspace:^"
Expand Down
5 changes: 4 additions & 1 deletion packages/@glimmer-workspace/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
"@glimmer/interfaces": "workspace:^",
"@glimmer/util": "workspace:^"
},
"devDependencies": {
"eslint": "^8.52.0"
},
"scripts": {
"test:lint": "eslint .",
"test:types": "tsc --noEmit -p ../tsconfig.json"
}
}
}
77 changes: 77 additions & 0 deletions packages/@glimmer/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,82 @@ module.exports = {
'@typescript-eslint/unbound-method': 'off',
},
},
//////////////////////////////////////////////////////////
// Remove when https://github.com/glimmerjs/glimmer-vm/pull/1462
// is merged.
//////////////////////////////////////////////////////////
{
files: [
'vm/lib/registers.ts',
'dom-change-list/test/support.ts',
'node/lib/serialize-builder.ts',
'util/lib/immediate.ts',
'util/test/immediate-test.ts',
'runtime/lib/vm/rehydrate-builder.ts',
'runtime/lib/dom/normalize.ts',
'syntax/lib/parser/handlebars-node-visitors.ts',
],
rules: {
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
},
},
{
files: ['interfaces/lib/compile/encoder.ts'],
rules: {
'@typescript-eslint/no-duplicate-type-constituents': 'off',
},
},
{
files: [
'compiler/lib/builder/builder-interface.ts',
'syntax/test/support.ts',
'destroyable/test/destroyables-test.ts',
'syntax/test/plugin-node-test.ts',
'syntax/test/loc-node-test.ts',
'syntax/test/parser-node-test.ts',
'dom-change-list/test/support.ts',
'reference/test/iterable-test.ts',
'reference/test/references-test.ts',
'test/traversal/visiting-keys-node-test.ts',
'syntax/test/traversal/visiting-node-test.ts',
'syntax/test/traversal/visiting-keys-node-test.ts',
],
rules: {
'@typescript-eslint/no-redundant-type-constituents': 'off',
},
},
{
files: [
'util/lib/debug-to-string.ts',
'debug/lib/debug.ts',
'manager/lib/public/component.ts',
'manager/lib/public/helper.ts',
'manager/lib/public/modifier.ts',
'runtime/lib/debug-render-tree.ts',
'runtime/lib/compiled/opcodes/content.ts',
'syntax/lib/v2/normalize.ts',
],
rules: {
'@typescript-eslint/no-base-to-string': 'off',
},
},
{
files: ['util/lib/simple-cast.ts'],
rules: {
'valid-typeof': 'off',
},
},
{
files: ['syntax/lib/source/source.ts'],
rules: {
'@typescript-eslint/no-inferrable-types': 'off',
},
},
{
files: ['validator/lib/utils.ts'],
rules: {
'n/no-unsupported-features/es-builtins': 'off',
},
},
],
};
1 change: 1 addition & 0 deletions packages/@glimmer/compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@glimmer/wire-format": "workspace:^"
},
"devDependencies": {
"eslint": "^8.52.0",
"rollup": "^3.21.6",
"@glimmer/local-debug-flags": "workspace:^",
"@glimmer-workspace/build-support": "workspace:^",
Expand Down
1 change: 1 addition & 0 deletions packages/@glimmer/debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@glimmer/vm": "workspace:^"
},
"devDependencies": {
"eslint": "^8.52.0",
"rollup": "^3.21.6",
"@glimmer/local-debug-flags": "workspace:^",
"toml": "^3.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@glimmer/destroyable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@glimmer/util": "workspace:^"
},
"devDependencies": {
"eslint": "^8.52.0",
"rollup": "^3.21.6",
"@glimmer/local-debug-flags": "workspace:^",
"@glimmer-workspace/build-support": "workspace:^"
Expand Down
1 change: 1 addition & 0 deletions packages/@glimmer/dom-change-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@glimmer/interfaces": "workspace:^"
},
"devDependencies": {
"eslint": "^8.52.0",
"rollup": "^3.21.6",
"@glimmer/local-debug-flags": "workspace:^",
"@glimmer-workspace/build-support": "workspace:^"
Expand Down
1 change: 1 addition & 0 deletions packages/@glimmer/encoder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"build": "rollup -c rollup.config.mjs"
},
"devDependencies": {
"eslint": "^8.52.0",
"rollup": "^3.21.6",
"@glimmer-workspace/build-support": "workspace:^"
}
Expand Down