-
-
Notifications
You must be signed in to change notification settings - Fork 285
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
"Definition for rule '@typescript/eslint/....' was not found" error happening in js, cjs and mjs files #749
Comments
+1 for @typescript-eslint/naming-convertion: "rules": {
"@typescript-eslint/naming-convention": [
{
"selector": "variableLike",
"modifiers": [
"private"
],
"format": [
"camelCase"
],
"leadingUnderscore": "require"
}
],
}
|
yes - xo applies the rules to every file, but in the case of a JS file in a typescript project, it may be better to use overrides to prevent it from trying to apply the TS rules to those files: {
"overrides": [
"files": "*.ts",
"rules" {
"@typescript-eslint/...": [...]
}
]
} |
This issues is definitely not closed. This is not a fix for the problem, that it is not possible to provide the correct configuration for this rule it in any manner. @spence-s |
Your example is syntactically wrong. The error you pasted explicitly tells you that it is incorrect syntax and that you are missing the severity. See my example below, it works just fine. - also the original issue was not about this rule, but about xo not finding @typescript-eslint rules which I gave a valid work around for... This works totally fine for me - using the latest xo module.exports = {
prettier: true,
parserOptions: {
project: './tsconfig.xo.json',
},
rules: {
'@typescript-eslint/naming-convention': ['error',{
selector: 'variable',
types: ['boolean'],
format: ['PascalCase'],
prefix: ['is', 'should', 'has', 'can', 'did', 'will'],
}],
],
}
}; (actual file not shown, just the line that uses the rule) const Test = true;
|
Thanks for your reply, will try that out. Ok, my issues is solved too then. Thanks for your time. :) |
So I am having an issue when overriding/replacing some default rules from XO when it comes to js, cjs and mjs files.
I have the following in my
.xo-config.json
file:When I come to any of the js, cjs and mjs files, this is the error I get at the beginning of the file:
Any reasons why does this happen?
The text was updated successfully, but these errors were encountered: