Comments (3)
Directives are widely considered to be an antipattern long predating React's attempt to add them (the language has long had a policy of "no more pragmas" post-strict-mode), and I don't think it's a good idea to encourage further usages of them. I think building your own is the best approach.
from eslint-plugin-import.
Since that's react-specific, it'd be more appropriate for eslint-plugin-react, but since it's cross-file-specific, this is basically the only plugin that checks that.
I'd say that if that's generally useful, it's something the react team should be providing. Either way, I'd caution you against building tooling for unreleased versions of React.
from eslint-plugin-import.
I'm particularly interested in a lint for my own directive "use node", which isn't a React thing. But similar to the React lint, it's probably my job to provide this to my users, not eslint-plugin-import's. While I'm curious about a more general version like "modules without directive X cannot import modules with directive X" that might be more configuration that is convenient.
I'll leave it to you to close this issue, maybe linting for directives like this is common enough for a general version to be useful? But I'll build my own for now.
from eslint-plugin-import.
Related Issues (20)
- This plugin does not report `import/extensions` and `import/no-unresolved` errors on `import type …` constructs HOT 3
- Making `ExportMap` available in `eslint-module-utils`?
- Update `tsconfig-paths` dependency to v4 HOT 1
- Regression in import/order rule after v2.26 HOT 1
- Mixed `type` imports does not trigger `import/no-duplicates` HOT 1
- Config to match vscode import sorting default HOT 2
- corrupted dependencies on windows?
- How to make it recognise internal modules as not external?
- Support for eslint v9 alternative HOT 1
- `import/consistent-type-specifier-style` for exports HOT 1
- Even larger `import/no-cycle` performance downgrade in 2.30.0 HOT 9
- eslint(import/named) reports `not found` errors in 2.30.0 HOT 7
- Enhancement: [import/no-restricted-paths] accept target exceptions HOT 5
- Missing documentation on how to setup eslint-plugin-import with flat confiuration and Typescript HOT 13
- eslint > 9 as peer dependency of eslint HOT 3
- import/no-named-as-default-member rule became less useful in 2.30.0 HOT 1
- Missing `^9` eslint peer dependency HOT 2
- After upgrade from 2.29.1 to 2.30.0 get "Parse errors" in react-toastify: "parser.parse is not a function (undefined:undefined) import/no-deprecated" HOT 13
- 🐞: [import/newline-after-import] Cannot recoginize the last require when use import and require in the same file 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-import.