develop #83
@ -5,31 +5,84 @@ import eslint from "@eslint/js";
|
|||||||
import nextPlugin from "@next/eslint-plugin-next";
|
import nextPlugin from "@next/eslint-plugin-next";
|
||||||
import unicornPlugin from "eslint-plugin-unicorn";
|
import unicornPlugin from "eslint-plugin-unicorn";
|
||||||
import prettierConfig from "eslint-config-prettier";
|
import prettierConfig from "eslint-config-prettier";
|
||||||
|
import { FlatCompat } from "@eslint/eslintrc";
|
||||||
|
import { fileURLToPath } from "url";
|
||||||
|
import { dirname } from "path";
|
||||||
|
|
||||||
export default [
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
eslint.configs.recommended,
|
const __dirname = dirname(__filename);
|
||||||
...tseslint.configs.recommended,
|
const compat = new FlatCompat({
|
||||||
|
baseDirectory: __dirname
|
||||||
|
});
|
||||||
|
|
||||||
|
const eslintConfig = [
|
||||||
|
{
|
||||||
|
ignores: ["node_modules/**", ".next/**", "out/**", "build/**", "next-env.d.ts"],
|
||||||
|
},
|
||||||
|
// Base JS/TS config
|
||||||
{
|
{
|
||||||
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
|
files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"],
|
||||||
plugins: {
|
|
||||||
"@next/next": nextPlugin,
|
|
||||||
"unicorn": unicornPlugin,
|
|
||||||
},
|
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
...globals.browser,
|
...globals.browser,
|
||||||
...globals.node,
|
...globals.node,
|
||||||
},
|
},
|
||||||
parser: tseslint.parser,
|
},
|
||||||
parserOptions: {
|
plugins: {
|
||||||
project: "./tsconfig.json",
|
"@next/next": nextPlugin,
|
||||||
},
|
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
...nextPlugin.configs.recommended.rules,
|
...nextPlugin.configs.recommended.rules,
|
||||||
...nextPlugin.configs["core-web-vitals"].rules,
|
...nextPlugin.configs["core-web-vitals"].rules,
|
||||||
...unicornPlugin.configs.recommended.rules,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// TypeScript specific config
|
||||||
|
{
|
||||||
|
files: ["**/*.{ts,tsx}"],
|
||||||
|
plugins: {
|
||||||
|
"unicorn": unicornPlugin,
|
||||||
|
},
|
||||||
|
languageOptions: {
|
||||||
|
parser: tseslint.parser,
|
||||||
|
parserOptions: {
|
||||||
|
project: "./tsconfig.json",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
...tseslint.configs.recommended.rules,
|
||||||
|
...unicornPlugin.configs.recommended.rules,
|
||||||
|
// Disable noisy unicorn rules
|
||||||
|
"unicorn/prevent-abbreviations": "off",
|
||||||
|
"unicorn/filename-case": "off",
|
||||||
|
"unicorn/no-null": "off",
|
||||||
|
"unicorn/consistent-function-scoping": "off",
|
||||||
|
"unicorn/no-array-for-each": "off",
|
||||||
|
"unicorn/catch-error-name": "off",
|
||||||
|
"unicorn/explicit-length-check": "off",
|
||||||
|
"unicorn/no-array-reduce": "off",
|
||||||
|
"unicorn/prefer-spread": "off",
|
||||||
|
"unicorn/no-document-cookie": "off",
|
||||||
|
"unicorn/prefer-query-selector": "off",
|
||||||
|
"unicorn/prefer-add-event-listener": "off",
|
||||||
|
"unicorn/prefer-string-slice": "off",
|
||||||
|
"unicorn/prefer-string-replace-all": "off",
|
||||||
|
"unicorn/prefer-number-properties": "off",
|
||||||
|
"unicorn/consistent-existence-index-check": "off",
|
||||||
|
"unicorn/no-negated-condition": "off",
|
||||||
|
"unicorn/switch-case-braces": "off",
|
||||||
|
"unicorn/prefer-global-this": "off",
|
||||||
|
"unicorn/no-useless-undefined": "off",
|
||||||
|
"unicorn/no-array-callback-reference": "off",
|
||||||
|
"unicorn/no-array-sort": "off",
|
||||||
|
"unicorn/numeric-separators-style": "off",
|
||||||
|
"unicorn/prefer-optional-catch-binding": "off",
|
||||||
|
"unicorn/prefer-ternary": "off",
|
||||||
|
"unicorn/prefer-code-point": "off",
|
||||||
|
"unicorn/prefer-single-call": "off",
|
||||||
|
}
|
||||||
|
},
|
||||||
prettierConfig,
|
prettierConfig,
|
||||||
|
...compat.extends("next/core-web-vitals"),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export default eslintConfig;
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"lint": "next lint",
|
"lint": "eslint .",
|
||||||
"start": "next start"
|
"start": "next start"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -86,6 +86,7 @@
|
|||||||
"tailwindcss": "^4.1.9",
|
"tailwindcss": "^4.1.9",
|
||||||
"tw-animate-css": "1.3.3",
|
"tw-animate-css": "1.3.3",
|
||||||
"typescript": "^5",
|
"typescript": "^5",
|
||||||
"typescript-eslint": "^8.45.0"
|
"typescript-eslint": "^8.45.0",
|
||||||
|
"@eslint/eslintrc": "^3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
3
susconecta/pnpm-lock.yaml
generated
3
susconecta/pnpm-lock.yaml
generated
@ -183,6 +183,9 @@ importers:
|
|||||||
specifier: 3.25.67
|
specifier: 3.25.67
|
||||||
version: 3.25.67
|
version: 3.25.67
|
||||||
devDependencies:
|
devDependencies:
|
||||||
|
'@eslint/eslintrc':
|
||||||
|
specifier: ^3
|
||||||
|
version: 3.3.1
|
||||||
'@eslint/js':
|
'@eslint/js':
|
||||||
specifier: ^9.36.0
|
specifier: ^9.36.0
|
||||||
version: 9.36.0
|
version: 9.36.0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user