Skip to content

Commit

Permalink
Fix eslint-config-turbo configuration in examples. (#8405)
Browse files Browse the repository at this point in the history
### Description

Fixing my own mistake on wrong reference pattern for ESLint
configurations. Come on, rookie!

Also, sneaking in change to remove the root TSConfig file from the
`basic` example. It isn't needed to run TypeScript in package
directories and don't want to confuse folks.
  • Loading branch information
anthonyshew authored Jun 10, 2024
1 parent 7b928eb commit 6be185f
Show file tree
Hide file tree
Showing 36 changed files with 214 additions and 167 deletions.
3 changes: 2 additions & 1 deletion examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"prettier": "^3.2.5",
"turbo": "^2.0.3"
"turbo": "^2.0.3",
"typescript": "^5.4.5"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/packages/eslint-config/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/packages/eslint-config/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
"eslint:recommended",
"prettier",
require.resolve("@vercel/style-guide/eslint/next"),
"eslint-config-turbo",
"turbo",
],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/packages/eslint-config/react-internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
9 changes: 9 additions & 0 deletions examples/basic/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions examples/basic/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion examples/kitchen-sink/packages/config-eslint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
16 changes: 9 additions & 7 deletions examples/kitchen-sink/packages/config-eslint/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ const project = resolve(process.cwd(), "tsconfig.json");

module.exports = {
extends: [
"@vercel/style-guide/eslint/node",
"@vercel/style-guide/eslint/typescript",
"@vercel/style-guide/eslint/browser",
"@vercel/style-guide/eslint/react",
"@vercel/style-guide/eslint/next",
"eslint-config-turbo",
].map(require.resolve),
...[
"@vercel/style-guide/eslint/node",
"@vercel/style-guide/eslint/typescript",
"@vercel/style-guide/eslint/browser",
"@vercel/style-guide/eslint/react",
"@vercel/style-guide/eslint/next",
].map(require.resolve),
"turbo",
],
parserOptions: {
project,
},
Expand Down
2 changes: 1 addition & 1 deletion examples/with-berry/packages/eslint-config/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-berry/packages/eslint-config/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
"eslint:recommended",
"prettier",
require.resolve("@vercel/style-guide/eslint/next"),
"eslint-config-turbo",
"turbo",
],
globals: {
React: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-changesets/packages/eslint-config/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-changesets/packages/eslint-config/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
"eslint:recommended",
"prettier",
require.resolve("@vercel/style-guide/eslint/next"),
"eslint-config-turbo",
"turbo",
],
globals: {
React: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-docker/packages/eslint-config/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-docker/packages/eslint-config/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
"eslint:recommended",
"prettier",
require.resolve("@vercel/style-guide/eslint/next"),
"eslint-config-turbo",
"turbo",
],
globals: {
React: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-gatsby/packages/eslint-config/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-gatsby/packages/eslint-config/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
"eslint:recommended",
"prettier",
require.resolve("@vercel/style-guide/eslint/next"),
"eslint-config-turbo",
"turbo",
],
globals: {
React: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-npm/packages/eslint-config/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-npm/packages/eslint-config/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
"eslint:recommended",
"prettier",
require.resolve("@vercel/style-guide/eslint/next"),
"eslint-config-turbo",
"turbo",
],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-npm/packages/eslint-config/react-internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-prisma/packages/config-eslint/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-prisma/packages/config-eslint/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
"eslint:recommended",
"prettier",
require.resolve("@vercel/style-guide/eslint/next"),
"eslint-config-turbo",
"turbo",
],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-rollup/packages/config-eslint/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-rollup/packages/config-eslint/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
"eslint:recommended",
"prettier",
require.resolve("@vercel/style-guide/eslint/next"),
"eslint-config-turbo",
"turbo",
],
globals: {
React: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const project = resolve(process.cwd(), "tsconfig.json");

/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
extends: ["eslint:recommended", "prettier", "turbo"],
plugins: ["only-warn"],
globals: {
React: true,
Expand Down
14 changes: 7 additions & 7 deletions examples/with-tailwind/apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"next": "^14.1.1",
"@repo/ui": "workspace:*",
"next": "^14.2.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@repo/ui": "workspace:*"
"react-dom": "^18.2.0"
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.1.1",
"@next/eslint-plugin-next": "^14.2.3",
"@repo/eslint-config": "workspace:*",
"@repo/tailwind-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/node": "^20.11.24",
"@types/react": "^18.2.61",
"@types/react-dom": "^18.2.19",
"autoprefixer": "^10.4.18",
"@repo/eslint-config": "workspace:*",
"postcss": "^8.4.35",
"@repo/tailwind-config": "workspace:*",
"tailwindcss": "^3.4.1",
"@repo/typescript-config": "workspace:*",
"typescript": "^5.3.3"
}
}
14 changes: 7 additions & 7 deletions examples/with-tailwind/apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"next": "^14.1.1",
"@repo/ui": "workspace:*",
"next": "^14.2.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@repo/ui": "workspace:*"
"react-dom": "^18.2.0"
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.1.1",
"@next/eslint-plugin-next": "^14.2.3",
"@repo/eslint-config": "workspace:*",
"@repo/tailwind-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/node": "^20.11.24",
"@types/react": "^18.2.61",
"@types/react-dom": "^18.2.19",
"autoprefixer": "^10.4.18",
"@repo/eslint-config": "workspace:*",
"postcss": "^8.4.35",
"@repo/tailwind-config": "workspace:*",
"tailwindcss": "^3.4.1",
"@repo/typescript-config": "workspace:*",
"typescript": "^5.3.3"
}
}
16 changes: 9 additions & 7 deletions examples/with-tailwind/packages/config-eslint/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ const project = resolve(process.cwd(), "tsconfig.json");

module.exports = {
extends: [
"@vercel/style-guide/eslint/node",
"@vercel/style-guide/eslint/typescript",
"@vercel/style-guide/eslint/browser",
"@vercel/style-guide/eslint/react",
"@vercel/style-guide/eslint/next",
"eslint-config-turbo",
].map(require.resolve),
...[
"@vercel/style-guide/eslint/node",
"@vercel/style-guide/eslint/typescript",
"@vercel/style-guide/eslint/browser",
"@vercel/style-guide/eslint/react",
"@vercel/style-guide/eslint/next",
].map(require.resolve),
"turbo",
],
parserOptions: {
project,
},
Expand Down
Loading

0 comments on commit 6be185f

Please sign in to comment.