Comments (12)
From the comments on your linked issue it actually seems like this eslint-plugin-etc
package should be using ts-api-utils
instead of the outdated tsutils
package, there is not going to be a new version of tsutils
published, ts-api-utils
IS the new version made by the eslint team. I was planning to make a PR, but it seems like the entire stack of *etc
is based on tsutils
, so I'll leave you to update this, but I did want to inform you about this development in that issue.
from eslint-plugin-etc.
Thanks for reading that issue's comments more thoroughly than I did, @Jelmerro. I'll take a look at ts-api-utils
to see what'll be involved in getting things upgraded.
from eslint-plugin-etc.
I've taken a look at this. Fixing this is not straightforward, as the error is being effected from a dep that's pretty deep down:
A lot of these lint rules rely on tsutils
, so this is likely to remain a problem until it's fixed in that package and a new version is published.
from eslint-plugin-etc.
Also got an error on
Error while loading rule 'etc/no-internal': Cannot read properties of undefined (reading 'text')
Appears to happen on TS 5.2 and 5.3
from eslint-plugin-etc.
I was doing a TS 5.2 upgrade today and saw this issue. However, I wasn't seeing any problem on TS 5.2 in my own project, which doesn't configure eslint-plugin-etc
to do anything but the default.
i.e. all I do in .eslintrc.js
is this:
plugins: [
// other plugins
'etc'
]
Curious what the repro steps are for an issue? For example, do I need code that breaks a certain rule, or a certain rule enabled, to see an issue?
I am on version 2.0.2
if that makes a difference.
from eslint-plugin-etc.
Curious what the repro steps are for an issue? For example, do I need code that breaks a certain rule, or a certain rule enabled, to see an issue?
Can you share the full configuration? Because of course, if you not enabling ANY eslint-plugin-etc rules, you are not gonna see any errors.
from eslint-plugin-etc.
You may have missed my edit above, I have since added my config :)
from eslint-plugin-etc.
You may have missed my edit above, I have since added my config :)
I mean the whole file.
from eslint-plugin-etc.
I use lots of lint configs, so I won't post the whole thing, but the only other relevant part of the file (to eslint-plugin-etc
) is the config for one of the rules:
'etc/no-implicit-any-catch': ['error', {allowExplicitAny: false}],
Otherwise, the plugin
bit above should mean that I'm using the recommended rule set, I believe:
but maybe that's not how it works 🤔
from eslint-plugin-etc.
Ah, right, I forgot, that is indeed not how it works. I don't have
extends: ["plugin:etc/recommended"],
so i guess I'll amend my previous statement: It seems like this one rule etc/no-implicit-any-catch
works fine on TS 5.2 from my limited tests :)
from eslint-plugin-etc.
I have the same issue of #64 (comment)
I specifically for:
type AnyObject = Record<string, unknown>;
// HERE IS THE LINE THAT BREAK
function pick<T extends AnyObject, K extends keyof T>(
obj: T,
keys: Array<K>
): Pick<T, K> {
const picked: Partial<Pick<T, K>> = {};
for (const key of keys) {
if (key in obj) {
picked[key] = obj[key];
}
}
return picked as Pick<T, K>;
}
and the rule that breaks is "etc/no-misused-generics": "error",
from eslint-plugin-etc.
Any news on this? 😉
from eslint-plugin-etc.
Related Issues (20)
- Feature request: prefer-type
- etc/no-deprecated: support detection within `exports`
- [etc/prefer-interface]: Does not report constructor signature
- `etc/prefer-interface` conflicts with `@typescript-eslint/prefer-function-type` HOT 1
- It seems much similar to `eslint-plugin-sonar` and `eslint-plugin-unicorn`
- `etc/throw-error` crash when rejecting with no value
- `no-commented-out-code` thinks that `// TODO: SOME-TICKET-NR-123` is code
- no-commented-out-code can't detect the chinese comment HOT 1
- `prefer-interface` rule fixer causes compilation error". An interface can only extend an object type or intersection of object types with statically known members"
- no-internal: Ignore internals defined in the same file
- TypeScript 5 support HOT 4
- Is there a way to set no-commented-out-code HOT 1
- Upgrade eslint-etc to v5.2.1
- TypeError: Cannot read properties of undefined (reading 'parent') HOT 2
- Cannot read properties of undefined 'typeAnnotation'
- Specify what rules are compatible with Javascript and what ones can only work with Typescript
- [Feature request] `prefer-readonly-array`
- [no-assign-mutated-array] doesn't account for `flatMap`
- [no-commented-out-code] Property declaration not detected
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-etc.