Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-sort-imports-requires

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-sort-imports-requires - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

11

lib/index.js

@@ -1,4 +0,9 @@

module.exports.rules = {
'sort-imports': require('./rules/sort-imports'),
'sort-requires': require('./rules/sort-requires')
module.exports = {
meta: {},
configs: {},
rules: {
'sort-imports': require('./rules/sort-imports'),
'sort-requires': require('./rules/sort-requires')
},
processors: {}
};

@@ -40,3 +40,2 @@ const checkDeclarationOrder = require('./declaration-order-checker');

meta: {
/* eslint-disable sort-keys */
type: 'suggestion',

@@ -102,3 +101,2 @@ docs: {

}
/* eslint-enable sort-keys */
}

@@ -105,0 +103,0 @@ });

{
"name": "eslint-plugin-sort-imports-requires",
"version": "1.0.2",
"version": "2.0.0",
"description": "An ESLint plugin to sort both import and require declarations in a unified manner.",

@@ -17,29 +17,30 @@ "keywords": [

"main": "lib/index.js",
"files": [
"lib"
],
"repository": "github:uphold/eslint-plugin-sort-imports-requires",
"publishConfig": {
"access": "public"
},
"scripts": {
"changelog": "uphold-scripts changelog $npm_package_version",
"lint": "uphold-scripts lint",
"lint-staged": "lint-staged -q",
"release": "uphold-scripts release",
"test": "mocha tests --recursive",
"version": "uphold-scripts version"
"lint": "eslint .",
"release": "release-it",
"test": "mocha tests --recursive"
},
"devDependencies": {
"eslint": "~8.7.0",
"mocha": "^9.2.0",
"prettier": "^2.5.1",
"uphold-scripts": "^0.6.0"
"@eslint/js": "^9.12.0",
"@uphold/github-changelog-generator": "^3.4.0",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.11.0",
"mocha": "^10.7.3",
"prettier": "^3.3.3",
"release-it": "^17.9.0"
},
"pre-commit": [
"lint-staged"
],
"lint-staged": {
"*.js": [
"uphold-scripts lint"
]
},
"engines": {
"node": "14.x || >= 16"
"node": ">= 20"
},
"peerDependencies": {
"eslint": ">=8"
"eslint": ">=9"
},

@@ -46,0 +47,0 @@ "license": "MIT",

@@ -16,5 +16,5 @@ # eslint-plugin-sort-imports-requires

- Provides autofix for potentially unsafe situations (see [`unsafeAutofix`](#unsafeAutofix)).
- Allows sorting by aliases. (see [`useAliases`](#useAliases)).
- Allows restoring the old ESLint behavior where `multiple` type corresponds to all named imports, regardless of how many are imported (see [`useOldSingleMemberSyntax`](#useOldSingleMemberSyntax)).
- Provides autofix for potentially unsafe situations (see [`unsafeAutofix`](#unsafeautofix)).
- Allows sorting by aliases. (see [`useAliases`](#usealiases)).
- Allows restoring the old ESLint behavior where `multiple` type corresponds to all named imports, regardless of how many are imported (see [`useOldSingleMemberSyntax`](#useoldsinglemembersyntax)).

@@ -26,3 +26,3 @@ ## Installation

```sh
❯ npm i eslint --save-dev
npm install eslint --save-dev
```

@@ -33,3 +33,3 @@

```sh
❯ npm install eslint-plugin-sort-imports-requires --save-dev
npm install eslint-plugin-sort-imports-requires --save-dev
```

@@ -39,21 +39,19 @@

Add `sort-imports-requires` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
Add `sort-imports-requires` to the plugins section of your ESLint configuration file and configure its rules. Here's an example:
```json
{
"plugins": [
"sort-imports-requires"
]
}
```
```js
// eslint.config.js
import sortImportRequires from 'eslint-plugin-sort-imports-requires';
Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"sort-imports-requires/sort-imports": "error",
"sort-imports-requires/sort-requires": "error"
export default [
{
plugins: {
'sort-imports-requires': sortImportRequires
},
rules: {
'sort-imports-requires/sort-imports': ['error', { unsafeAutofix: true }],
'sort-imports-requires/sort-requires': ['error', { unsafeAutofix: true }]
}
}
}
];
```

@@ -98,6 +96,26 @@

# License
## License
[MIT](https://opensource.org/licenses/MIT)
## Contributing
### Development
Install dependencies:
```bash
npm i
```
Run tests:
```bash
npm run test
```
### Cutting a release
The release process is automated via the [release](https://github.com/uphold/eslint-plugin-sort-imports-requires/actions/workflows/release.yaml) GitHub workflow. Run it by clicking the "Run workflow" button.
[npm-image]: https://img.shields.io/npm/v/eslint-plugin-sort-imports-requires.svg

@@ -104,0 +122,0 @@ [npm-url]: https://www.npmjs.com/package/eslint-plugin-sort-imports-requires

Sorry, the diff of this file is not supported yet

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