Comments (8)
Just tested, works great!
from eslint-plugin-total-functions.
Have you bumped into #16 ?
from eslint-plugin-total-functions.
from eslint-plugin-total-functions.
I have not yet, but would prefer that subscript access be split up into an array rule and an object rule. The rule for arrays, while not perfect, solves a pain point in typescript. I'm less concerned about object indexing which at least in my codebase is far more common than array indexing.
from eslint-plugin-total-functions.
would prefer that subscript access be split up into an array rule and an object rule
That's a fair point. PR welcome, otherwise I'll get to it soonish.
from eslint-plugin-total-functions.
For the object and array decoupling: #28
from eslint-plugin-total-functions.
The explanation for this issue:
There's a limitation in the rule such that it won't consider non-literal keys (even if the key's type is keyof typeof ...
or const
).
So this won't (currently) pass the rule:
const period: keyof typeof periods = 'oneDay';
periods[period];
but this will:
periods['oneDay'];
This is the object cousin of the array limitation in #16.
Happy to accept a PR, otherwise I'll fix this soonish too.
from eslint-plugin-total-functions.
This might be fixed by the latest release. Please update and let me know @tankers746
from eslint-plugin-total-functions.
Related Issues (20)
- New rule: skipLibCheck must be false HOT 2
- rewrite mutable<->readonly assignment rules in terms of is-immutable-type lib? HOT 4
- New rule: forbid unsafe enum assignment HOT 5
- [total-functions/no-partial-division] false negatives HOT 4
- New rule: ban promises
- New rule: prevent unsafe assignment of fp-ts types HOT 2
- no-unsafe-mutable-readonly-assignment should whitelist `Array.from` HOT 4
- Array method whitelisting is too permissive
- New rule: no partial array reduce
- Improve recursive type checking HOT 2
- New rule: ban Proxy
- New rule: detect premature logging in fp-ts code
- New rule: no-hidden-type-assertions (`getMeAT<T>(): T`) HOT 3
- no-unsafe-mutable-readonly-assignment: doesn't catch call signature assignment when params are omitted HOT 2
- New rule: suspicious fp-ts either usage
- no-unsafe-mutable-readonly-assignment: another stackoverflow
- no-unsafe-readonly-mutable-assignment failing to identify a ReadonlyShallow correctly HOT 1
- no-unsafe-type-assertion: redundant thanks to `satisfies`?
- Why is an empty object literal (`{}`) considered immutable? HOT 2
- [total-functions/no-unsafe-readonly-mutable-assignment] False positive? 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-total-functions.