mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-24 13:01:24 +01:00
merge completed... now to fix all the bugs...
This commit is contained in:
commit
87c4d80fbc
3472 changed files with 466748 additions and 6517 deletions
66
node_modules/eslint-plugin-import/docs/rules/no-relative-packages.md
generated
vendored
Normal file
66
node_modules/eslint-plugin-import/docs/rules/no-relative-packages.md
generated
vendored
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
# import/no-relative-packages
|
||||
|
||||
Use this rule to prevent importing packages through relative paths.
|
||||
|
||||
It's useful in Yarn/Lerna workspaces, were it's possible to import a sibling
|
||||
package using `../package` relative path, while direct `package` is the correct one.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
Given the following folder structure:
|
||||
|
||||
```
|
||||
my-project
|
||||
├── packages
|
||||
│ ├── foo
|
||||
│ │ ├── index.js
|
||||
│ │ └── package.json
|
||||
│ └── bar
|
||||
│ ├── index.js
|
||||
│ └── package.json
|
||||
└── entry.js
|
||||
```
|
||||
|
||||
And the .eslintrc file:
|
||||
```
|
||||
{
|
||||
...
|
||||
"rules": {
|
||||
"import/no-relative-packages": "error"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The following patterns are considered problems:
|
||||
|
||||
```js
|
||||
/**
|
||||
* in my-project/packages/foo.js
|
||||
*/
|
||||
|
||||
import bar from '../bar'; // Import sibling package using relative path
|
||||
import entry from '../../entry.js'; // Import from parent package using relative path
|
||||
|
||||
/**
|
||||
* in my-project/entry.js
|
||||
*/
|
||||
|
||||
import bar from './packages/bar'; // Import child package using relative path
|
||||
```
|
||||
|
||||
The following patterns are NOT considered problems:
|
||||
|
||||
```js
|
||||
/**
|
||||
* in my-project/packages/foo.js
|
||||
*/
|
||||
|
||||
import bar from 'bar'; // Import sibling package using package name
|
||||
|
||||
/**
|
||||
* in my-project/entry.js
|
||||
*/
|
||||
|
||||
import bar from 'bar'; // Import sibling package using package name
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue