-
Notifications
You must be signed in to change notification settings - Fork 59
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
aegir lint complaints about imports in ts files #618
Comments
@hugomrdias could we leave out |
Actually it looks like overrides could be used to provide different rules based on file type https://eslint.org/docs/user-guide/configuring#specifying-processor |
Following local {
"overrides": [
{
"files": [
"**/*.ts"
],
"extends": "./node_modules/aegir/src/config/eslintrc-ts.js"
},
{
"files": [
"**/*.js"
],
"extends": "./node_modules/aegir/src/config/eslintrc.js"
}
]
} But now I see problem when running tests
Not sure what is causing this one. |
I am starting to think that maybe |
Without this change `aegir` either uses esmodule parse rules or script based parse rules, which causes issues with repos that contain both `.ts` and `.js` files regardless of `--ts` option. Without `--ts` option it complains about `import` statements with `--ts` option it complains about use of unnecessary `'use strict'`. This change introduces config for eslint that overrides based on file type using js config for js files and ts config for ts files. It also adds a test case which fails without this change. Fixes #618 BREAKING CHANGE: new linting file used for .ts files
Describe the bug
As the following pull request illustrates multiformats/js-multiaddr#131
aegir lint
complains about imports ints
files.As far as I can tell that happens because it lints
.ts
filesaegir/src/lint.js
Lines 9 to 20 in 2fe4403
With JS configuration unless global
ts
option is usedhttps://github.com/ipfs/aegir/blob/master/src/lint.js#L86
This creates problems in cases where project combination of
.ts
and.js
files.I'm not too familiar with ESLint, but as far as I can tell there's no way to specify different
parseOptions
per file typeaegir/src/config/eslintrc-ts.js
Lines 5 to 7 in 2fe4403
The text was updated successfully, but these errors were encountered: