Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint typed linting does not work #63

Closed
Jxlle opened this issue Feb 19, 2024 · 2 comments
Closed

ESLint typed linting does not work #63

Jxlle opened this issue Feb 19, 2024 · 2 comments

Comments

@Jxlle
Copy link

Jxlle commented Feb 19, 2024

I recently updated my .eslintrc.json:

I changed plugin:@typescript-eslint/recommended to plugin:@typescript-eslint/recommended-type-checked to activate typed linting source. After this change, I can see new errors locally and everything seems to work great. However, CodeFactor reports no issues on PR's after this change, not even issues that were present before changing this rule. It seems that CodeFactor struggles to interpret this typed linting config, but it does not report any error of some sort on the dashboard, just 'no issues', while I definitely have issues locally. Is there some way to fix this?

{
    // Indicates that this is the root ESLint file (you can have multiple)
    "root": true,
    // We use TypeScript, so it's good to use the TypeScript parser
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "project": true
    },
    // Plugins for extra ESLint rules
    "plugins": [
        "@typescript-eslint",
        "@stylistic",
        "cypress"
    ],
    // Inherit rulesets to use by default
    "extends": [
        "eslint:recommended",
        "plugin:@typescript-eslint/recommended-type-checked",
        "plugin:cypress/recommended"
    ],
    // Custom rules
    "rules" : {
        // Disables rule that namespaces cannot be used
        "@typescript-eslint/no-namespace": "off",
        // Warn if Cypress wait command is used
        "cypress/no-unnecessary-waiting": "warn",
        // Warn if unsafe Cypress chaining is used
        "cypress/unsafe-to-chain-command": "off", //? CodeFactor sees this as an issue if enabled, although it's a warning, so currently disabled
        // Prefer template literals (`I am ${name}`) instead of the '+' operator ('I am' + name)
        "prefer-template": "error",
        // Enforce === and !== instead of == and !==
        "eqeqeq": "error",
        // Enforces one true brace style
        "@stylistic/brace-style": "error",
        // Enforces that lines end with a semicolon
        "@stylistic/semi": ["error", "always"],
        // Disallow spaces inside of brackets
        "@stylistic/array-bracket-spacing": "error",
        // Enforce normalized arrow function style
        "@stylistic/arrow-spacing": ["error", {
            "before": true,
            "after": true
        }],
        // Enforces that files do not contain newlines at beginning or end and a maximum of two newlines at other locations
        "@stylistic/no-multiple-empty-lines": ["error", {
            "max": 2,
            "maxEOF": 0,
            "maxBOF": 0
        }],
        // Enforce single quotes on strings that are not template literals
        "@stylistic/quotes": ["error", "single"],
        // Enforce capitalized comments
        "capitalized-comments": ["error", "always", {
            // Ignore the rule on consecutive comments because the text of a sentence may continue on the line below it
            "ignoreConsecutiveComments": true
        }],
        // Enforces space after comment
        "@stylistic/spaced-comment": ["error", "always", {
            "line": {
                // Exception to this rule: /******...
                "exceptions": ["*"],
                // Allow specific comment styles: ///, //!, //?, //*
                "markers": ["/", "!", "?", "*"]
            },
            // Enforce balanced comment blocks
            "block": {
                "balanced": true
            }
        }]
    }
}
@cordis-dev
Copy link
Contributor

@Jxlle thank you, we'll look into this.

@cordis-dev
Copy link
Contributor

@Jxlle CodeFactor should now report type-aware rules for your ESLint config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants