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
Support for typescript #114
Comments
Thank you for this issue. For now, we cannot check |
Now that |
I see #138 is now closed. Does this mean that TypeScript is now supported? There is no mention of TypeScript in readme. |
v2.0.0-alpha.0, released this weekend, should work with |
I made a pull request for adding it to a project. I get the following error message.
See https://github.com/maasglobal/scrapql/pull/73/files |
@btmills Thanks for this plugin! I faced the same error for my typescript project when I used Error:
Setup that is working for me currently with v2: .eslintrc.js module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.eslint.json',
},
plugins: [
'markdown',
],
overrides: [
{
// Enable the Markdown processor for all .md files.
files: ['**/*.md'],
processor: 'markdown/markdown',
},
]
} tsconfig.eslint.json:
I tried including |
Maybe adding |
Having the same issue as @mohanraj-r, can this issue be reopened as it doesn't seem possible to use |
Same issue. Any known workaround? |
Same issue, if add *.md mask for linting.
|
Unfortunately it's not possible to use type-aware linting rules with any ESLint processors, this Markdown plugin included. Since code blocks aren't real |
@btmills Why #114 was closed? Where I can see working configuration example for Typescript? I tried your example, but no success |
@viT-1 if something is broken in the TypeScript example, please open an issue describing what's broken or better yet a PR to fix it! If you're able to use some |
The same problem here, any workaround to avoid the error message from
|
@laozhu remove |
Thank you, solved this. Some types-required rules have to be disabled for typescript blocks in markdown. |
I've tried changing the eslint command for a project here from "eslint --ext .ts,.tsx,.js ." to "eslint ." and am seeing the same error reported by others here /home/bumble/software/snabbdom/README.md
790:1 error Parsing error: ESLint was configured to run on `<tsconfigRootDir>/README.md/33_33.tsx` using `parserOptions.project`:
- <tsconfigRootDir>/tsconfig.json
- <tsconfigRootDir>/test/tsconfig.json
However, none of those TSConfigs include this file. Either:
- Change ESLint's list of included files to not include this file
- Change one of those TSConfigs to include this file
- Create a new TSConfig that includes this file and include it in your parserOptions.project
See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file The project does not define Would anyone tell me what I'm doing wrong? I've tried explicitly setting null parserOptions.project, but it did not have any effect {
"files": ["**/*.md"],
"processor": "markdown/markdown",
"parserOptions": {
"project": null
}
} |
The issue was resolved by explicitly ignoring README-related files in the eslint typescript configuration. The full PR and changes are here snabbdom/snabbdom#1074 |
For flat config, this snippet should help: {
files: ['**/*.md/**'],
languageOptions: {
parserOptions: {
project: null,
},
},
} |
I'm using https://github.com/typescript-eslint/typescript-eslint for linting typescript files with eslint. Would it be possible to also lint typescript-blocks inside markdown files with this plugin?
The text was updated successfully, but these errors were encountered: