Initial commit
This commit is contained in:
46
tooling/eslint/base.js
Normal file
46
tooling/eslint/base.js
Normal file
@@ -0,0 +1,46 @@
|
||||
/** @type {import("eslint").Linter.Config} */
|
||||
const config = {
|
||||
extends: [
|
||||
"turbo",
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended-type-checked",
|
||||
"plugin:@typescript-eslint/stylistic-type-checked",
|
||||
"prettier",
|
||||
],
|
||||
env: {
|
||||
es2022: true,
|
||||
node: true,
|
||||
},
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: {
|
||||
project: true,
|
||||
},
|
||||
plugins: ["@typescript-eslint", "import"],
|
||||
rules: {
|
||||
"turbo/no-undeclared-env-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
||||
],
|
||||
"@typescript-eslint/consistent-type-imports": [
|
||||
"warn",
|
||||
{ prefer: "type-imports", fixStyle: "separate-type-imports" },
|
||||
],
|
||||
"@typescript-eslint/no-misused-promises": [
|
||||
2,
|
||||
{ checksVoidReturn: { attributes: false } },
|
||||
],
|
||||
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
||||
},
|
||||
ignorePatterns: [
|
||||
"**/.eslintrc.cjs",
|
||||
"**/*.config.js",
|
||||
"**/*.config.cjs",
|
||||
".next",
|
||||
"dist",
|
||||
"pnpm-lock.yaml",
|
||||
],
|
||||
reportUnusedDisableDirectives: true,
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
9
tooling/eslint/nextjs.js
Normal file
9
tooling/eslint/nextjs.js
Normal file
@@ -0,0 +1,9 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
const config = {
|
||||
extends: ["plugin:@next/next/recommended"],
|
||||
rules: {
|
||||
"@next/next/no-html-link-for-pages": "off",
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
42
tooling/eslint/package.json
Normal file
42
tooling/eslint/package.json
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "@acme/eslint-config",
|
||||
"version": "0.2.0",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"./base.js",
|
||||
"./nextjs.js",
|
||||
"./react.js"
|
||||
],
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"lint": "eslint .",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@next/eslint-plugin-next": "^14.0.3",
|
||||
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
||||
"@typescript-eslint/parser": "^6.10.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-config-turbo": "^1.10.16",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"eslint-plugin-react": "^7.33.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/eslint": "^8.44.7",
|
||||
"@acme/prettier-config": "workspace:^0.1.0",
|
||||
"@acme/tsconfig": "workspace:^0.1.0",
|
||||
"eslint": "^8.53.0",
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": [
|
||||
"./base.js"
|
||||
]
|
||||
},
|
||||
"prettier": "@acme/prettier-config"
|
||||
}
|
||||
24
tooling/eslint/react.js
vendored
Normal file
24
tooling/eslint/react.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
const config = {
|
||||
extends: [
|
||||
"plugin:react/recommended",
|
||||
"plugin:react-hooks/recommended",
|
||||
"plugin:jsx-a11y/recommended",
|
||||
],
|
||||
rules: {
|
||||
"react/prop-types": "off",
|
||||
},
|
||||
globals: {
|
||||
React: "writable",
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: "detect",
|
||||
},
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
8
tooling/eslint/tsconfig.json
Normal file
8
tooling/eslint/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "@acme/tsconfig/base.json",
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||
},
|
||||
"include": ["."],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
3
tooling/github/package.json
Normal file
3
tooling/github/package.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"name": "@acme/github"
|
||||
}
|
||||
17
tooling/github/setup/action.yml
Normal file
17
tooling/github/setup/action.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
name: "Setup and install"
|
||||
description: "Common setup steps for Actions"
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- uses: pnpm/action-setup@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
cache: "pnpm"
|
||||
|
||||
- shell: bash
|
||||
run: pnpm add -g turbo
|
||||
|
||||
- shell: bash
|
||||
run: pnpm install
|
||||
32
tooling/prettier/index.mjs
Normal file
32
tooling/prettier/index.mjs
Normal file
@@ -0,0 +1,32 @@
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
/** @typedef {import("prettier").Config} PrettierConfig */
|
||||
/** @typedef {import("prettier-plugin-tailwindcss").PluginOptions} TailwindConfig */
|
||||
/** @typedef {import("@ianvs/prettier-plugin-sort-imports").PluginConfig} SortImportsConfig */
|
||||
|
||||
/** @type { PrettierConfig | SortImportsConfig | TailwindConfig } */
|
||||
const config = {
|
||||
plugins: [
|
||||
"@ianvs/prettier-plugin-sort-imports",
|
||||
"prettier-plugin-tailwindcss",
|
||||
],
|
||||
tailwindConfig: fileURLToPath(
|
||||
new URL("../../tooling/tailwind/index.ts", import.meta.url),
|
||||
),
|
||||
importOrder: [
|
||||
"^(react/(.*)$)|^(react$)|^(react-native(.*)$)",
|
||||
"^(next/(.*)$)|^(next$)",
|
||||
"^(expo(.*)$)|^(expo$)",
|
||||
"<THIRD_PARTY_MODULES>",
|
||||
"",
|
||||
"^@acme/(.*)$",
|
||||
"",
|
||||
"^~/",
|
||||
"^[../]",
|
||||
"^[./]",
|
||||
],
|
||||
importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"],
|
||||
importOrderTypeScriptVersion: "4.4.0",
|
||||
};
|
||||
|
||||
export default config;
|
||||
21
tooling/prettier/package.json
Normal file
21
tooling/prettier/package.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "@acme/prettier-config",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"main": "index.mjs",
|
||||
"scripts": {
|
||||
"clean": "rm -rf .turbo node_modules",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ianvs/prettier-plugin-sort-imports": "^4.1.1",
|
||||
"prettier": "^3.1.0",
|
||||
"prettier-plugin-tailwindcss": "^0.5.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@acme/tsconfig": "workspace:^0.1.0",
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"prettier": "@acme/prettier-config"
|
||||
}
|
||||
8
tooling/prettier/tsconfig.json
Normal file
8
tooling/prettier/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "@acme/tsconfig/base.json",
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||
},
|
||||
"include": ["."],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
21
tooling/typescript/base.json
Normal file
21
tooling/typescript/base.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"lib": ["dom", "dom.iterable", "ES2022"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "Bundler",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"noUncheckedIndexedAccess": true
|
||||
},
|
||||
"exclude": ["node_modules", "build", "dist", ".next", ".expo"]
|
||||
}
|
||||
8
tooling/typescript/package.json
Normal file
8
tooling/typescript/package.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "@acme/tsconfig",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"files": [
|
||||
"base.json"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user