Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign uprequested plugin's rules not successfully being added to the linting config object #1252
Comments
This comment has been minimized.
This comment has been minimized.
|
it would be helpful if any of the standard developers who are well versed in eslint (even if you're not a typescript user), could pitch in and help diagnose why the `"@typescript-eslint" plugin's rules are discarded. I'd be happy to even pair on it some evening (I'm in PST) |
This comment has been minimized.
This comment has been minimized.
|
I don't think standard picks up any new rules at all, if you want to configure your rules you'll probably have to use Maybe eslint-config-standard-with-typescript would suit your needs btw? |
This comment has been minimized.
This comment has been minimized.
|
@LinusU, the docs claim first class compat with typescript, thus, this should work. |
This comment has been minimized.
This comment has been minimized.
despian
commented
Jun 20, 2019
|
I agree the docs state that there is ts support but the fact is it's just broken. #1007 suggests merging the rules from eslint-config-standard-with-typescript into standard. I think this sounds like a great idea. |
This comment has been minimized.
This comment has been minimized.
|
Adding a plugin does not automatically enable rules. You need to add rules to the eslint config in order for them to be enabled. In the case of We'll likely solve this properly in a future version of |
This comment has been minimized.
This comment has been minimized.
|
One thing I don't understand is why adding a plugin automatically enables rules when used with |
cdaringe commentedFeb 20, 2019
What version of standard?
12.0.1
What operating system, Node.js, and npm version?
node 11, osx, npm 6.x
What did you expect to happen?
by providing:
i expect the eslint config to have many
@typescript-eslint/<rule-name>in theconfig.rulesset, however, all are missing when eslint actually tries to lint files.all other rules from the other plugins, e.g.
['node', 'import', ..., 'standard']show up. i'm setting breakpoints eslint'scli-engine.js, and seeing the completed config (afterconfigHelper.plugins.loadAll(config.plugins);), but the@typescript-eslint/<rule-name>rules are all missing :(What actually happened?
no
@typescript-eslint/<rule-name>rules are presentdiscussion
i see that
eslintis calling load on the plugin, and i seedefineRulebeing called with@typescript-eslint/<rule-name>rules. however, the final config is missing these rules.in a barebones eslint project, the following eslintrc does add these rules to the eslint config:
{ "extends": ["plugin:@typescript-eslint/recommended"], "parser": "@typescript-eslint/parser", "plugins": ["@typescript-eslint"] }and the resultant config looks akin to:
{ "globals": {}, "env": {}, "rules": { "@typescript-eslint/adjacent-overload-signatures": "error", ... "@typescript-eslint/no-triple-slash-reference": "error", "no-unused-vars": "off", "@typescript-eslint/type-annotation-spacing": "error" }, "parserOptions": { "sourceType": "module" }, "parser": "/Users/c0d01a5/node/eslint-ts-no-unused-issue/node_modules/@typescript-eslint/parser/dist/parser.js", "plugins": [ "@typescript-eslint" ], "extends": [ "plugin:@typescript-eslint/recommended" ] }the eslint code is highly stateful, and i'm not certain how a
Linter'srulesMapis supposed to fold back into the config object that's passed to the linting context. either way,standarddoes not seem to be loading this rule as promised, wherein off-the-shelf does load the plugin (5.14.0***) no problem.would love to see if anyone could successfully get standard to load that plugin full well!