Comments (6)
It all comes back to type analysis. The easier it is to infer that a given variable is of a given type, the easier it is to write this type of rule.
from eslint-plugin-unicorn.
@jamestalmage Sure, but in this case, the template literal or string is always put inline in the function call. If not, we could always use path analysis it's a 99% certainty it's in the same file. But yeah, many other cases might be harder. I don't think that should limit our brainstorming here though.
from eslint-plugin-unicorn.
Oh - I meant ensuring meow
was meow
. But yes, it also applies to the template variable as well. Not against it - just saying adding a lot of type dependent rules without a good typing system is burdensome (echoing what we have already said)
from eslint-plugin-unicorn.
@jamestalmage Yeah, totally, but don't limit your brainstorming to type dependent rules. Lots of other things that could be useful. I should have found a better example in the issue description than a type dependent one.
from eslint-plugin-unicorn.
My point was that type analysis is required for any "uses XXX appropriately" rule. You have to narrow down that a given variable is of type XXX. It's easy for meow
since you basically always use the import directly.
from eslint-plugin-unicorn.
Closing discussion as inactive for 4 years. Now there's a node-specific plugin: https://github.com/mysticatea/eslint-plugin-node
from eslint-plugin-unicorn.
Related Issues (20)
- `explicit-length-check`: false positive when checking presence of property in TypeScript HOT 1
- no-empty-file should be configurable HOT 1
- Add support for flat config (`eslint.config.js`) HOT 1
- Option proposal: `explicit-length-check`: provide option to invert to require implicit length check HOT 1
- Rule proposal: `no-non-exists-builtin-properties` HOT 2
- bun:jsc being flagged as required node:protocol HOT 3
- no-array-for-each autofix is unsafe for sparse arrays HOT 2
- `unicorn/prefer-at` incorrectly fixes object property key lookup
- Rule proposal: `prefer-logical-operator-over-ternary` for explicit truthy, falsy and nullish conditions HOT 2
- `unicorn/prefer-spread` treats `string.slice(0)` like an array HOT 2
- Rule proposal: no inline callbacks before other parameters HOT 2
- no-negated-condition extra `ignore undefined` option. HOT 1
- In v50.0.0 , lodash dependency is missing HOT 2
- Rule proposal: `prefer-array-find-last` HOT 1
- Export types for use in flat configs
- `unicorn/explicit-length-check` does not report when optional chaining
- `unicorn/no-invalid-remove-event-listener` does not report when optional chaining
- Support `import.meta.dirname` and `import.meta.filename` in `prefer-module` rule HOT 5
- Rule proposal: `no-single-promise-in-promise-methods` HOT 2
- Rule proposal: `no-await-in-promise-methods` HOT 2
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-unicorn.