Comments (6)
@uhyo Makes sense! I'll publish my version then in case anyone is interested in the Strict Mode
. Renamed @package
to @scope
. Thank you! :)
from eslint-plugin-import-access.
Thank you for your suggestion! Unfortunately neither is possible currently.
If this rule doesn't work for default exports, it is a bug. I haven't tested it with default exports 😨
The entire file rule is definitely great to have, but I haven't figured out a nice way of specifying file-level rules.
I'll try to work on them 🙂
from eslint-plugin-import-access.
Hi @uhyo! We decided to work on this issue at the same time 😅 A week ago I finally had some time to dive into this... As I didn't have experience writing ESLint/TS plugins before I decided to start from scratch to have a full understanding of what is going on. Obviously, it is heavily inspired by your implementation.
That's what I have at the moment
You can check out the README to see how it works. What do you think? Would you like to merge it into your repo? It's ok if you don't 😄 The actual implementation fits into 4 files.
Missing options compared to your version:
indexLoophole
- it's the default behaviour when in Strict ModefilenameLoophole
- can it be solved by colocating related files in the same directory?
I don't like that my version requires parserOptions.project
to be configured, but I couldn't make eslint work without this setting with your version as well 🤷♂️
from eslint-plugin-import-access.
I kept the same package name in case you want to merge, but I've changed the rule name as ESLint recommends to start disallow
rules with no-
from eslint-plugin-import-access.
Looks like there's no way around parserOptions.project
.
Added support for "Path Tags"
from eslint-plugin-import-access.
@A-Shleifman First of all, sorry for my slow work 🥺 and yes, this kind of plugins need parserOptions.project
, so as mine. Otherwise we have to perform module resolution by ourselves without help of TypeScript's built-in resolver.
Actually your implementation is impressing; the idea of Strict Mode and Path Tags are interesting.
However, I think it is a little difficult to merge your implementation into mine for two reasons. You implemented the plugin from scratch so it is hard to fusion the two implementations. Also, your @package
semantics has departed a bit too far from JSDon's known semantics, and that's not how I would like my plugin to look like.
So I think you can give your own name to your plugin and go on. Thank you for sharing!
from eslint-plugin-import-access.
Related Issues (11)
- private:reexport is allowed HOT 2
- Proposal: selfReferencingLoophole HOT 3
- An update is recommended. HOT 2
- Cannot retrieve TypeScript program for this file import-access/jsdoc HOT 3
- `import * as namespace` is not checked HOT 1
- Flat Config Support HOT 1
- ESLint v9 Support
- Does eslint-plugin-import-access need to be added to eslintrc _and_ tsconfig or either? HOT 1
- Import from export * cause error HOT 2
- When is v1.0.2 release? HOT 1
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-access.