-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Biome is fantastic and kept around for additional linting, but ESLint still has specific plugins which are useful across the ecosystem
- Loading branch information
Showing
26 changed files
with
254 additions
and
98 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,167 @@ | ||
const { resolve } = require("node:path") | ||
|
||
const project = resolve(process.cwd(), "tsconfig.json") | ||
|
||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
require.resolve("@vercel/style-guide/eslint/browser"), | ||
require.resolve("@vercel/style-guide/eslint/react"), | ||
require.resolve("@vercel/style-guide/eslint/next"), | ||
require.resolve("@vercel/style-guide/eslint/node"), | ||
require.resolve("@vercel/style-guide/eslint/typescript"), | ||
"next/core-web-vitals", | ||
"plugin:tailwindcss/recommended" | ||
], | ||
env: { | ||
node: true, | ||
browser: true | ||
}, | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: true | ||
}, | ||
settings: { | ||
"import/resolver": { | ||
typescript: { | ||
project | ||
} | ||
}, | ||
tailwindcss: { | ||
callees: ["className", "clsx", "cls", "cva", "cn"] | ||
} | ||
}, | ||
ignorePatterns: [ | ||
// Ignore dotfiles | ||
".*.js", | ||
"node_modules/", | ||
"dist/" | ||
], | ||
overrides: [ | ||
/** | ||
* Config files | ||
*/ | ||
{ | ||
files: ["*.config.{js,ts}"], | ||
env: { | ||
node: true | ||
}, | ||
rules: { | ||
"@typescript-eslint/no-var-requires": "off", | ||
"import/no-default-export": "off" | ||
} | ||
}, | ||
/** | ||
* Test Configuration | ||
*/ | ||
{ | ||
files: ["**/__tests__/**/*.{ts,tsx}", "**/*.test.{ts,tsx}"], | ||
extends: [require.resolve("@vercel/style-guide/eslint/vitest")], | ||
rules: { | ||
/** | ||
* Allow non-null assertions in tests | ||
*/ | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
/** | ||
* Don't require description for disabling eslint here | ||
*/ | ||
"eslint-comments/require-description": "off" | ||
} | ||
}, | ||
/** | ||
* Next.js configuration / exports | ||
*/ | ||
{ | ||
files: [ | ||
"app/**/page.tsx", | ||
"app/**/layout.tsx", | ||
"app/**/loading.tsx", | ||
"app/**/not-found.tsx", | ||
"app/**/*error.tsx", | ||
"app/sitemap.ts", | ||
"app/robots.ts", | ||
"app/manifest.ts" | ||
], | ||
rules: { | ||
"import/no-default-export": "off", | ||
"import/prefer-default-export": ["error", { target: "any" }] | ||
} | ||
}, | ||
/** | ||
* JSX/TSX specific config | ||
*/ | ||
{ | ||
files: ["**/*.{jsx,tsx}"], | ||
rules: { | ||
"no-nested-ternary": "off" | ||
} | ||
} | ||
], | ||
rules: { | ||
"@typescript-eslint/consistent-type-definitions": ["error", "type"], | ||
"@typescript-eslint/consistent-type-imports": [ | ||
"error", | ||
{ prefer: "type-imports", fixStyle: "separate-type-imports" } | ||
], | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"@typescript-eslint/no-misused-promises": [ | ||
"error", | ||
{ | ||
checksVoidReturn: { | ||
arguments: false, | ||
attributes: false | ||
} | ||
} | ||
], | ||
"@typescript-eslint/no-unused-vars": [ | ||
"warn", | ||
{ | ||
argsIgnorePattern: "^_", | ||
caughtErrors: "none", | ||
varsIgnorePattern: "^_" | ||
} | ||
], | ||
"@typescript-eslint/restrict-template-expressions": [ | ||
"warn", | ||
{ | ||
allowBoolean: true, | ||
allowNumber: true | ||
} | ||
], | ||
"import/order": [ | ||
"error", | ||
{ | ||
"newlines-between": "never", | ||
groups: [ | ||
["builtin", "external", "internal"], | ||
["sibling", "parent"], | ||
"index", | ||
"object" | ||
// "type" | ||
], | ||
alphabetize: { | ||
order: "asc" | ||
} | ||
} | ||
], | ||
"no-console": [ | ||
"warn", | ||
{ | ||
allow: ["warn", "error"] | ||
} | ||
], | ||
"sort-imports": [ | ||
"error", | ||
{ | ||
ignoreDeclarationSort: true | ||
} | ||
], | ||
"tailwindcss/no-custom-classname": [ | ||
"error", | ||
{ | ||
cssFiles: ["app/globals.css"] | ||
} | ||
] | ||
} | ||
} |
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,3 +1,7 @@ | ||
{ | ||
"recommendations": ["biomejs.biome", "bradlc.vscode-tailwindcss"] | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"biomejs.biome", | ||
"bradlc.vscode-tailwindcss" | ||
] | ||
} |
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
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
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
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
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
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
Oops, something went wrong.