-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(eslint): better messaging and bug fix (#3950
A few fixes for the eslint plugin. 1. Fix error message to remove the leading `$` since that was deprecated in 1.5 2. Provides more explicit error messaging 3. Fixes a bug that could cause the rule to exit early if no global deps were provided 4. Cleans up / standardizes tests and mocks This should also fix #3943
- Loading branch information
Showing
34 changed files
with
252 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/eslint-plugin-turbo/__fixtures__/configs/single/turbo.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
// new style, global env dependency | ||
"globalEnv": ["NEW_STYLE_GLOBAL_ENV_KEY", "$NEW_STYLE_GLOBAL_ENV_KEY"], | ||
// old style, global env dependency (deprecated) | ||
"globalDependencies": ["$GLOBAL_ENV_KEY"], | ||
"pipeline": { | ||
"test": { | ||
"outputs": ["coverage/**"], | ||
"dependsOn": ["^build"] | ||
}, | ||
"lint": { | ||
"outputs": [] | ||
}, | ||
"dev": { | ||
"cache": false | ||
}, | ||
"build": { | ||
"outputs": ["dist/**", ".next/**", "!.next/.cache/**"], | ||
// task level env var deps | ||
"env": ["NEW_STYLE_ENV_KEY"], | ||
// old task level env var deps (deprecated) | ||
"dependsOn": ["^build", "$TASK_ENV_KEY", "$ANOTHER_ENV_KEY"] | ||
} | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...ures/workspace-configs/apps/docs/index.js → ...es__/workspace-configs/apps/docs/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export default function docs() { | ||
if (process.env.ENV_1 === undefined) { | ||
return 'does not exist'; | ||
return "does not exist"; | ||
} | ||
return 'exists' | ||
return "exists"; | ||
} |
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
packages/eslint-plugin-turbo/__fixtures__/workspace-configs/apps/docs/turbo.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"extends": ["//"], | ||
"pipeline": { | ||
"build": { | ||
"env": ["ENV_3"] | ||
} | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...tures/workspace-configs/apps/web/index.js → ...res__/workspace-configs/apps/web/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export default function web() { | ||
if (!process.env.ENV_2) { | ||
return 'bar'; | ||
return "bar"; | ||
} | ||
return 'foo' | ||
return "foo"; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...es/workspace-configs/packages/ui/index.js → ...__/workspace-configs/packages/ui/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export default function foo() { | ||
if (!process.env.IS_SERVER) { | ||
return 'bar'; | ||
return "bar"; | ||
} | ||
return 'foo' | ||
return "foo"; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
packages/eslint-plugin-turbo/__fixtures__/workspace/child/child.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
process.env.NONEXISTENT; | ||
process.env.CI; |
12 changes: 7 additions & 5 deletions
12
...ts__/fixtures/workspace/package-lock.json → .../__fixtures__/workspace/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
packages/eslint-plugin-turbo/__fixtures__/workspace/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"eslint-plugin-turbo": "../../" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
process.env.CI; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
packages/eslint-plugin-turbo/__tests__/fixtures/configs/single/turbo.json
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
packages/eslint-plugin-turbo/__tests__/fixtures/workspace/child/child.js
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
packages/eslint-plugin-turbo/__tests__/fixtures/workspace/package.json
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/eslint-plugin-turbo/__tests__/fixtures/workspace/peer.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
953adf4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
turbo-site – ./docs
turbo.vercel.app
turbo.build
turbo.vercel.sh
www.turbopack.org
www.turborepo.com
turbopack.org
turborepo.org
turbo-site.vercel.sh
www.turbo.build
www.turborepo.org
turbo-site-git-main.vercel.sh