eslint-plugin-sort-imports-requires
Advanced tools
Comparing version 1.0.2 to 2.0.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
120
25488
9
9
499
2