-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Turbobot <turbobot@vercel.com>
- Loading branch information
1 parent
09e15ea
commit 47ab0f7
Showing
18 changed files
with
3,561 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// This configuration only applies to the package manager root. | ||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
ignorePatterns: ["apps/**", "packages/**"], | ||
extends: ["@repo/eslint-config/library.js"], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: true, | ||
}, | ||
}; |
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 @@ | ||
name: Setup turbo | ||
description: "Setup pnpm, Node.js, turborepo and its own remote-caching server." | ||
inputs: | ||
node-version: | ||
description: "version of Node.js using setup." | ||
default: "20" | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Launch Turbo Remote Cache Server | ||
uses: dtinth/setup-github-actions-caching-for-turbo@v1.1.0 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
cache: pnpm | ||
cache-dependency-path: pnpm-lock.yaml | ||
- name: Install packages | ||
shell: sh | ||
run: pnpm install --frozen-lockfile | ||
|
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,26 @@ | ||
name: format-and-lint | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request_target: | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
prettier: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup-turbo | ||
- name: Run Prettier | ||
run: pnpm run format:check | ||
|
||
eslint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup-turbo | ||
- name: Run ESLint | ||
run: pnpm run lint | ||
|
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,38 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# Dependencies | ||
node_modules | ||
.pnp | ||
.pnp.js | ||
|
||
# Local env files | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# Testing | ||
coverage | ||
|
||
# Turbo | ||
.turbo | ||
|
||
# Vercel | ||
.vercel | ||
|
||
# Build Outputs | ||
.next/ | ||
out/ | ||
build | ||
dist | ||
|
||
|
||
# Debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Misc | ||
.DS_Store | ||
*.pem |
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,7 @@ | ||
{ | ||
"eslint.workingDirectories": [ | ||
{ | ||
"mode": "auto" | ||
} | ||
] | ||
} |
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,3 @@ | ||
# `@turbo/eslint-config` | ||
|
||
Collection of internal eslint configurations. |
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,34 @@ | ||
const { resolve } = require("node:path"); | ||
|
||
const project = resolve(process.cwd(), "tsconfig.json"); | ||
|
||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"], | ||
plugins: ["only-warn"], | ||
globals: { | ||
React: true, | ||
JSX: true, | ||
}, | ||
env: { | ||
node: true, | ||
}, | ||
settings: { | ||
"import/resolver": { | ||
typescript: { | ||
project, | ||
}, | ||
}, | ||
}, | ||
ignorePatterns: [ | ||
// Ignore dotfiles | ||
".*.js", | ||
"node_modules/", | ||
"dist/", | ||
], | ||
overrides: [ | ||
{ | ||
files: ["*.js?(x)", "*.ts?(x)"], | ||
}, | ||
], | ||
}; |
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,19 @@ | ||
{ | ||
"name": "@repo/eslint-config", | ||
"version": "0.0.0", | ||
"private": true, | ||
"files": [ | ||
"library.js", | ||
"next.js", | ||
"react-internal.js" | ||
], | ||
"devDependencies": { | ||
"@vercel/style-guide": "^5.1.0", | ||
"eslint-config-turbo": "^1.10.12", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-only-warn": "^1.1.0", | ||
"@typescript-eslint/parser": "^6.11.0", | ||
"@typescript-eslint/eslint-plugin": "^6.11.0", | ||
"typescript": "^5.2.2" | ||
} | ||
} |
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,43 @@ | ||
const { resolve } = require("node:path"); | ||
|
||
const project = resolve(process.cwd(), "tsconfig.json"); | ||
|
||
/* | ||
* This is a custom ESLint configuration for use with | ||
* internal (bundled by their consumer) libraries | ||
* that utilize React. | ||
* | ||
* This config extends the Vercel Engineering Style Guide. | ||
* For more information, see https://github.com/vercel/style-guide | ||
* | ||
*/ | ||
|
||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"], | ||
plugins: ["only-warn"], | ||
globals: { | ||
React: true, | ||
JSX: true, | ||
}, | ||
env: { | ||
browser: true, | ||
}, | ||
settings: { | ||
"import/resolver": { | ||
typescript: { | ||
project, | ||
}, | ||
}, | ||
}, | ||
ignorePatterns: [ | ||
// Ignore dotfiles | ||
".*.js", | ||
"node_modules/", | ||
"dist/", | ||
], | ||
overrides: [ | ||
// Force ESLint to detect .tsx files | ||
{ files: ["*.js?(x)", "*.ts?(x)"] }, | ||
], | ||
}; |
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,20 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"display": "Default", | ||
"compilerOptions": { | ||
"declaration": true, | ||
"declarationMap": true, | ||
"esModuleInterop": true, | ||
"incremental": false, | ||
"isolatedModules": true, | ||
"lib": ["es2022", "DOM", "DOM.Iterable"], | ||
"module": "NodeNext", | ||
"moduleDetection": "force", | ||
"moduleResolution": "NodeNext", | ||
"noUncheckedIndexedAccess": true, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"target": "ES2022" | ||
} | ||
} |
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 @@ | ||
{ | ||
"name": "@repo/typescript-config", | ||
"version": "0.0.0", | ||
"private": true, | ||
"license": "MIT", | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"display": "React Library", | ||
"extends": "./base.json", | ||
"compilerOptions": { | ||
"jsx": "react-jsx" | ||
} | ||
} |
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,20 @@ | ||
{ | ||
"name": "sugarform", | ||
"private": true, | ||
"scripts": { | ||
"build": "turbo build", | ||
"lint": "turbo lint -- --max-warnings=0", | ||
"format": "prettier --write \"**/*.{ts,tsx,md}\"", | ||
"format:check": "prettier --check \"**/*.{ts,tsx,md}\"" | ||
}, | ||
"devDependencies": { | ||
"@repo/eslint-config": "workspace:*", | ||
"@repo/typescript-config": "workspace:*", | ||
"prettier": "^3.1.0", | ||
"turbo": "latest" | ||
}, | ||
"packageManager": "pnpm@8.9.0", | ||
"engines": { | ||
"node": ">=18" | ||
} | ||
} |
Oops, something went wrong.