Comments (3)
Is there any way to achieve what I want?
Currently not, import *
is always disallowed. You can open a new rule change request.
from eslint.
This works as intended because pattern react
matches at any level (patterns are based on the .gitignore specification), so it does match '@my-org/utils/react'
. If you want a pattern that matches only top-level 'react'
, that would be /react
. Here's a playground example with "group": ["/react"]
:
Note that this also disallows import * as React from 'react'
.
from eslint.
Note that this also disallows
import * as React from 'react'
.
Thanks. This is something I wanted to avoid:
Note that using this:
{ "name": "react", "importNames": ["forwardRef"], "message": "..." }Is not good enough since it now errors on all of these lines:
import * as React from 'react';Which, while technically correct (since you can then use
React.forwardRef
) is too much of an overhead, and not what I want to fix here. I'll prevent usage ofReact.forwardRef
using another rule (no-restricted-syntax maybe
).
Is there any way to achieve what I want? Seems like a missing use-case for this rule. Perhaps an exact: true
option could be added to the object?
from eslint.
Related Issues (20)
- Bug: Migrate away from lodash method packages HOT 6
- Bug: `use-isnan` doesn't report NaN in `indexOf` or `lastIndexOf` when fromIndex is given HOT 5
- Docs: no-return-await deprecation notice leads to a wrong conclusion HOT 24
- Repo: remove internal multiline-comment-style fork/wrapper HOT 1
- Bug: The no-unused-var error cleared by duplicating React Router import
- Change Request: Rule Tester omit specific properties for duplicate test case detection HOT 2
- Change Request: Update strip-ansi to version 7 HOT 1
- Rule Change: no-fallthrough should not permit "falls through" comment when code will not fall through. HOT 4
- Repo: 'documentation' label added and removed quickly on PRs HOT 6
- Bug: `flat config global ignores` should support `git-ignore-alike-syntax` to negate pattern HOT 1
- Rule Change: no-extra-boolean-cast should check final expression in comma operator expressions HOT 5
- Docs: Page does not update when prefers-color-scheme changes HOT 3
- Docs: Option to use system preference for light/dark theme HOT 6
- Scheduled release for March 22nd, 2024 HOT 3
- Bug: cannot override no-unused-vars HOT 4
- Bug: Random error on line 1 column 1 Parsing error: Cannot read properties of undefined (reading 'map') eslint HOT 2
- Bug: Flat config file not found when run with `CWD` outside of source directory HOT 5
- Bug: Flat config doesn't work when `files` refers to a sibling directory. HOT 2
- ESlint error "Switch cases without blocks are disallowed. eslint (no-restricted-syntax)" HOT 2
- Change Request: Lazy import and initialize Linter 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.