Comments (9)
Closing for 4 years of inactivity and because this exists:
- JavaScript: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
- TypeScript: https://github.com/gund/eslint-plugin-deprecation
Reopen if unicorn needs to have its own version.
from eslint-plugin-unicorn.
Interesting! Can you show an example of how it would look?
from eslint-plugin-unicorn.
Relevant:
- https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
- import-js/eslint-plugin-import#193
- import-js/eslint-plugin-import#302
from eslint-plugin-unicorn.
Oh wow. That's a cool way to do it.
Might be slow though. Doesn't it have to load and parse every dependency?
from eslint-plugin-unicorn.
@benmosher ⬆️
from eslint-plugin-unicorn.
It does parse every dependency, but if you're already using the other rules that do static analysis the plugin only parses each dependency at most once, so turning on the no-deprecated rule doesn't add much extra time.
I also wrote an ESLint memoizing parser as an experiment, to cut parse time in half by allowing ESLint proper and the import plugin to share the same parsed AST instead of each parsing their own. It helps, but doesn't even really matter until the project gets big.
My day job application is made of about 1500 module files, IIRC, and takes ~15s to fully lint with the memo-parser.
from eslint-plugin-unicorn.
BTW, it currently uses JSDoc but could use whatever. It's not obvious to me how prevalent JSDoc is, I mostly use it internally to flag myself and others with yellow rectangles around deprecated identifiers in Sublime.
from eslint-plugin-unicorn.
@benmosher I assume the ESLint caching works fine with eslint-plugin-import
?
from eslint-plugin-unicorn.
Yes and no. If you change an imported file, the files that import it won't be invalidated so if any import issues have been introduced, they won't show up. I.E.:
Module A imports B. Lint A with --cache, then delete B, then re-lint A with --cache. I would expect it not to report B as missing since A's content still matches the last lint execution. I am not super-familiar with ESLint's caching though, so I may be wrong.
This is why I use eslint_d for faster console and Sublime linting; the in-process caches of exports default to invalidating after 30s, so an eslint_d re-lint of A would eventually report B as unresolved.
from eslint-plugin-unicorn.
Related Issues (20)
- Rule proposal: `no-single-promise-in-promise-methods` HOT 2
- Rule proposal: `no-await-in-promise-methods` HOT 2
- Rule proposal: `no-anonymous-default-export` HOT 2
- `error-message` believes that a joined array is empty when elements are conditionally pushed
- Consider remove autofixing unicorn/prevent-abbreviations HOT 5
- False positive for consistent-destructuring HOT 1
- Rule proposal: avoid loops to create `URLSearchParams` HOT 5
- False positive `array-from-async` in `unicorn/no-unnecessary-polyfills`
- Support `Array.fromAsync()`
- `no-array-callback-reference` false positive HOT 1
- Rule proposal: no-confusing-conditions HOT 1
- `string-content` rule: case insensitive matching
- Switch to flat config HOT 2
- `prefer-array-find` doesn't warn about `.at(0)`
- Change `numeric-separators-style` after decimal point HOT 2
- `unicorn/number-literal-case` conflicts with `prettier/prettier` HOT 5
- `no-array-callback-reference` false positive when using ternary
- `prefer-string-slice` bad autofix from `.substr()`
- `prevent-abbreviations` - non-ASCII characters ignored in filenames HOT 1
- `prefer-node-protocol` should not flag non-node imports 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.