mirror of
https://github.com/zen-browser/www.git
synced 2025-07-07 17:05:32 +02:00
feat(prettier): add prettier formatting
This commit is contained in:
parent
01f4dac75d
commit
7fafa6bc69
85 changed files with 5670 additions and 2788 deletions
|
@ -1,14 +1,15 @@
|
|||
import type { Linter } from "eslint";
|
||||
import { typescriptFiles } from "./shared";
|
||||
import { type Linter } from 'eslint'
|
||||
|
||||
import { typescriptFiles } from './shared'
|
||||
|
||||
export function createTypescriptConfig(tsConfigPath: string): Linter.Config {
|
||||
return {
|
||||
name: "eslint/typescript",
|
||||
name: 'eslint/typescript',
|
||||
files: typescriptFiles,
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
|
@ -18,27 +19,27 @@ export function createTypescriptConfig(tsConfigPath: string): Linter.Config {
|
|||
},
|
||||
rules: {
|
||||
// Basic TypeScript rules that work without type information
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: "^_",
|
||||
varsIgnorePattern: "^_",
|
||||
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/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"],
|
||||
'@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
|
||||
'no-unused-vars': 'off', // Handled by TypeScript
|
||||
'no-undef': 'off', // TypeScript handles this
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue