New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-quintoandar

Package Overview
Dependencies
Maintainers
9
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-quintoandar - npm Package Compare versions

Comparing version 1.9.3 to 1.10.0

rules/quintoandar-import-order.js

2

index.js

@@ -22,2 +22,3 @@ /* eslint-disable global-require */

'no-default-message': require('./rules/no-default-message'),
'quintoandar-import-order': require('./rules/quintoandar-import-order'),
},

@@ -41,2 +42,3 @@ configs: {

'no-default-message': 2,
'quintoandar-import-order': 2,
},

@@ -43,0 +45,0 @@ },

2

package.json
{
"name": "eslint-plugin-quintoandar",
"version": "1.9.3",
"version": "1.10.0",
"description": "An eslint-plugin for PWA-Tenants custom rules",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -201,2 +201,85 @@ <div align="center">

### QuintoAndar custom import order
Enforces the following custom import order:
1 - `react` import;
2 - external libs imports;
3 - `@quintoandar` imports;
4 - projects absolute imports;
5 - projects relative imports;
#### Why
This rule aims in the direction of standardizing our code style. Beyond that it makes easier to find the imports.
#### How to use it
Just add the code below in your rules array:
```js
"quintoandar/quintoandar-import-order": 2,
```
#### Options
##### projectAbsolutePaths
With the `projectAbsolutePaths` option you can pass extra paths to be evaluated as absolute paths from the project. You can use it adding the following to your rules array:
```js
'quintoandar/quintoandar-import-order': [
2,
{
projectAbsolutePaths: ['experiments/'],
},
],
```
With the above configuration, all imports from `experiments` will be considered internal imports from the project:
```js
// Start with external libs
import something from 'external-lib/something-a';
import anotherThing from 'external-lib/something-b';
// Then projects absolute imports
import SomeInternalComponent from 'components/SomeComponent';
import SomeInternalContainer from 'containers/SomeContainer';
import SomeExperiment from 'experiments/someExperiment';
import someInternalHelper from 'helpers/someHelper';
import someInternalUtil from 'utils/someUtil';
```
You can pass the `override` option too:
```js
'quintoandar/quintoandar-import-order': [
2,
{
override: true,
projectAbsolutePaths: ['components', 'containers', 'experiments/'],
},
],
```
This way the default absolute paths (`components/`, `containers/`, `helpers/` or `utils/`) are overwritten. So the code above would not valid anymore, but the following would be:
```js
// Start with external libs
import something from 'external-lib/something-a';
import anotherThing from 'external-lib/something-b';
import someInternalHelper from 'helpers/someHelper';
import someInternalUtil from 'utils/someUtil';
// Then projects absolute imports
import SomeInternalComponent from 'components/SomeComponent';
import SomeInternalContainer from 'containers/SomeContainer';
import SomeExperiment from 'experiments/someExperiment';
```
## Versioning

@@ -203,0 +286,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc