mirror of
https://github.com/Mastermindzh/code-style-conventions.git
synced 2025-07-15 23:14:29 +02:00
65 lines
1.7 KiB
JavaScript
65 lines
1.7 KiB
JavaScript
const mastermindzhConfig = require("@mastermindzh/eslint-config");
|
|
const typescriptEslint = require("@typescript-eslint/eslint-plugin");
|
|
const typescriptParser = require("@typescript-eslint/parser");
|
|
const importPlugin = require("eslint-plugin-import");
|
|
|
|
module.exports = [
|
|
// Global ignores (replaces .eslintignore)
|
|
{
|
|
ignores: [
|
|
"dist/**",
|
|
"build/**",
|
|
"public/**",
|
|
".cache/**",
|
|
"node_modules/**",
|
|
"*.config.js",
|
|
"*.config.ts",
|
|
],
|
|
},
|
|
...mastermindzhConfig,
|
|
{
|
|
// Only lint TypeScript files (matching your .eslintignore pattern)
|
|
files: ["**/*.ts", "**/*.tsx"],
|
|
languageOptions: {
|
|
parser: typescriptParser,
|
|
parserOptions: {
|
|
project: "./tsconfig.json",
|
|
},
|
|
},
|
|
plugins: {
|
|
"@typescript-eslint": typescriptEslint,
|
|
import: importPlugin,
|
|
},
|
|
// Your project-specific rules
|
|
rules: {
|
|
// Import rules
|
|
"import/no-extraneous-dependencies": [
|
|
"error",
|
|
{
|
|
devDependencies: [
|
|
"**/*.test.ts",
|
|
"**/*.test.tsx",
|
|
"**/internal/**/*.ts",
|
|
],
|
|
},
|
|
],
|
|
// TypeScript rules
|
|
"@typescript-eslint/no-unused-vars": "off",
|
|
"@typescript-eslint/no-use-before-define": "off",
|
|
// Use the correct rule name for quotes
|
|
quotes: ["error", "double"],
|
|
"@typescript-eslint/naming-convention": [
|
|
"error",
|
|
{
|
|
format: ["camelCase", "UPPER_CASE", "snake_case", "PascalCase"],
|
|
leadingUnderscore: "allow",
|
|
selector: "parameter",
|
|
},
|
|
],
|
|
// Shadow rules
|
|
"no-shadow": "off",
|
|
"@typescript-eslint/no-shadow": "error",
|
|
},
|
|
},
|
|
];
|