Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Ignorar configuración propia
.eslintrc.js
angular.json
tsconfig*.json
package*.json

# Ignorar archivos de build y dependencias
node_modules/
dist/**
342 changes: 135 additions & 207 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,214 +1,142 @@
/*
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
https://github.com/typescript-eslint/tslint-to-eslint-config
module.exports = {
root: true,

It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.
// Para ignorar algo global, ponerlo acá
ignorePatterns: [
"dist/**",
"**/*.min.*"
],

We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint.
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
// Overrides por tipo de archivo
overrides: [
// ==== Archivos TypeScript ====
{
files: ["*.ts"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["tsconfig.json"],
tsconfigRootDir: __dirname,
sourceType: "module"
},
plugins: [
"@angular-eslint",
"import",
"prefer-arrow",
"@typescript-eslint"
],
// Opcionalmente se puede añadir `extends: ["plugin:@angular-eslint/recommended"]` para setear defaults
rules: {
// --- reglas TS/Angular ---
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/indent": ["error", 4, {
ObjectExpression: "first",
FunctionDeclaration: { parameters: "first" },
FunctionExpression: { parameters: "first" },
SwitchCase: 1,
ArrayExpression: "first"
}],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-inferrable-types": ["error", { ignoreParameters: true }],
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/unified-signatures": "error",
"@typescript-eslint/member-delimiter-style": ["error", {
multiline: { delimiter: "semi", requireLast: true },
singleline: { delimiter: "semi", requireLast: false }
}],
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/quotes": ["error", "single"],

Happy linting! 💖
*/
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module",
"extraFileExtensions": [".html"]
},
"plugins": [
"@angular-eslint/eslint-plugin",
"eslint-plugin-import",
"eslint-plugin-prefer-arrow",
"@typescript-eslint"
],
"root": true,
"ignorePatterns": ["src/demo/**/*.html"],
"rules": {
"@angular-eslint/component-class-suffix": "error",
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
// "prefix": "plex",
"style": "kebab-case"
}
],
// "@angular-eslint/directive-class-suffix": "error",
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
// "prefix": "plex",
"style": "camelCase"
}
],
"@angular-eslint/no-input-rename": "error",
"@angular-eslint/no-output-rename": "error",
"@angular-eslint/use-pipe-transform-interface": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
// "@typescript-eslint/indent": [
// "error",
// 4,
// {
// "ObjectExpression": "first",
// "FunctionDeclaration": {
// "parameters": "first"
// },
// "FunctionExpression": {
// "parameters": "first"
// }
// }
// ],
// "@typescript-eslint/member-delimiter-style": [
// "error",
// {
// "multiline": {
// "delimiter": "semi",
// "requireLast": true
// },
// "singleline": {
// "delimiter": "semi",
// "requireLast": false
// }
// }
// ],
// "@typescript-eslint/naming-convention": [
// "error",
// {
// "selector": "variable",
// "format": [
// "camelCase",
// "UPPER_CASE"
// ],
// "leadingUnderscore": "forbid",
// "trailingUnderscore": "forbid"
// }
// ],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-inferrable-types": [
"error",
{
"ignoreParameters": true
}
],
// "@typescript-eslint/no-shadow": [
// "error",
// {
// "hoist": "all"
// }
// ],
// "@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/prefer-function-type": "error",
// "@typescript-eslint/quotes": [
// "error",
// "single"
// ],
// "@typescript-eslint/semi": [
// "error",
// "always"
// ],
// "@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
// "brace-style": [
// "error",
// "1tbs"
// ],
// "curly": "error",
"dot-notation": "off",
// "eol-last": "error",
// "eqeqeq": [
// "error",
// "smart"
// ],
"guard-for-in": "off",
"id-denylist": "off",
"id-match": "off",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": false
"@angular-eslint/component-class-suffix": ["error", { suffixes: ["Component"] }],
"@angular-eslint/directive-class-suffix": ["error", { suffixes: ["Directive"] }],
"@angular-eslint/no-host-metadata-property": "error",
"@angular-eslint/no-inputs-metadata-property": "error",
"@angular-eslint/no-outputs-metadata-property": "error",
"@angular-eslint/use-lifecycle-interface": "warn",
"@angular-eslint/use-pipe-transform-interface": "warn",
"@angular-eslint/no-outputs-metadata-property": "error",

"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": ["off", { accessibility: "explicit" }],

"@angular-eslint/component-selector": ["off", { type: "element", prefix: ["app", "mpi"], style: "kebab-case" }],
"@angular-eslint/directive-selector": ["off", { type: "attribute", prefix: ["app", "mpi", "tm"], style: "camelCase" }],

// Reglas JS/TS base
"indent": "off",
"keyword-spacing": ["error", { after: true, before: true }],
"space-before-blocks": ["error", { functions: "always", keywords: "always", classes: "always" }],
"brace-style": ["error", "1tbs", { allowSingleLine: true }],
"object-curly-spacing": ["error", "always"],
"curly": "error",
"comma-spacing": ["error", { before: false, after: true }],
"dot-notation": "off",
"eol-last": "error",
"eqeqeq": ["error", "smart"],
"no-bitwise": "error",
"no-caller": "error",
"no-console": ["error", { allow: ["debug", "info", "warn", "error", "trace", "time", "timeEnd"] }],
"no-debugger": "error",
"no-empty": "off",
"no-empty-function": "off",
"no-eval": "error",
"no-fallthrough": "error",
"no-new-wrappers": "error",
"no-redeclare": "error",
"no-restricted-imports": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-underscore-dangle": "off",
"no-unused-labels": "error",
"no-var": "error",
"prefer-const": ["error", { destructuring: "any", ignoreReadBeforeAssign: false }],
"prefer-arrow-callback": ["error", { allowUnboundThis: true, allowNamedFunctions: true }],
"space-before-function-paren": ["error", { anonymous: "always", named: "never", asyncArrow: "always" }],
"quotes": ["error", "single"],
"radix": "error",
"semi": "error",
"spaced-comment": ["error", "always", { markers: ["/"] }],
"array-bracket-spacing": ["error", "never", { singleValue: false, objectsInArrays: false, arraysInArrays: false }],
"no-irregular-whitespace": ["error", { skipComments: true }],
"no-multi-spaces": "error"
}
],
"indent": "off",
"max-len": [
"off",
{
"code": 140
},

// ==== Tests (*.spec.ts) ====
{
files: ["**/*.spec.ts"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: [
"projects/plex-demo/tsconfig.spec.json", // tsconfig de la demo para tests
"tsconfig.json" // por si importa algo comun
],
tsconfigRootDir: __dirname,
sourceType: "module"
},
env: {
jasmine: true, // habilita describe/it/expect como globales
node: true
},
rules: {
// Se puede desactivar reglas solo para tests si hace falta
// "@typescript-eslint/no-explicit-any": "off"
}
],
"no-bitwise": "error",
"no-caller": "error",
// "no-console": "error",
"no-constant-condition": "error",
"no-debugger": "error",
"no-empty": "off",
"no-empty-function": "off",
"no-eval": "error",
"no-fallthrough": "error",
"no-multiple-empty-lines": [
"error",
{
"max": 2
},

// ==== Plantillas Angular (HTML) ====
{
files: ["*.html"],
parser: "@angular-eslint/template-parser",
plugins: ["@angular-eslint/template"],
extends: ["plugin:@angular-eslint/template/recommended"],
rules: {
// Rglas de template (ej.: desactivar alguna)
// "@angular-eslint/template/eqeqeq": "off"
}
],
"no-new-wrappers": "error",
// "no-redeclare": "error",
"no-restricted-imports": "error",
"no-shadow": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-underscore-dangle": "off",
"no-unused-expressions": "off",
"no-unused-labels": "error",
// "no-var": "error",
// "object-shorthand": "error",
// "prefer-arrow/prefer-arrow-functions": [
// "error",
// {
// "allowStandaloneDeclarations": true
// }
// ],
"prefer-const": "error",
"prefer-object-spread": "error",
// "quote-props": [
// "error",
// "as-needed"
// ],
"quotes": "off",
// "radix": "error",
"semi": "off",
// "space-before-function-paren": [
// "error",
// {
// "anonymous": "always",
// "named": "never",
// "asyncArrow": "always"
// }
// ],
// "spaced-comment": [
// "error",
// "always",
// {
// "markers": [
// "/"
// ]
// }
// ],
}
}
]
};

Loading