mirror of
https://github.com/zen-browser/www.git
synced 2025-07-07 17:05:32 +02:00
feat(eslint): add eslint flat config
This commit is contained in:
parent
1937be58a6
commit
01f4dac75d
16 changed files with 4607 additions and 2125 deletions
44
.eslint/typescript.ts
Normal file
44
.eslint/typescript.ts
Normal file
|
@ -0,0 +1,44 @@
|
|||
import type { Linter } from "eslint";
|
||||
import { typescriptFiles } from "./shared";
|
||||
|
||||
export function createTypescriptConfig(tsConfigPath: string): Linter.Config {
|
||||
return {
|
||||
name: "eslint/typescript",
|
||||
files: typescriptFiles,
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
project: tsConfigPath,
|
||||
tsconfigRootDir: process.cwd(),
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Basic TypeScript rules that work without type information
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
argsIgnorePattern: "^_",
|
||||
varsIgnorePattern: "^_",
|
||||
ignoreRestSiblings: true,
|
||||
},
|
||||
],
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
"@typescript-eslint/no-explicit-any": "warn",
|
||||
"@typescript-eslint/no-non-null-assertion": "warn",
|
||||
"@typescript-eslint/consistent-type-imports": [
|
||||
"error",
|
||||
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
|
||||
],
|
||||
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
||||
|
||||
// Override base rules for TypeScript
|
||||
"no-unused-vars": "off", // Handled by TypeScript
|
||||
"no-undef": "off", // TypeScript handles this
|
||||
},
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue