eslint-plugin-simple-import-sort
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -0,1 +1,5 @@ | ||
### Version 2.1.0 (2019-01-26) | ||
- Added: [TypeScript] support, via [@typescript-eslint/parser]. | ||
### Version 2.0.0 (2018-11-30) | ||
@@ -26,4 +30,6 @@ | ||
<!-- prettier-ignore-start --> | ||
[@typescript-eslint/parser]: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser | ||
[flow type imports]: https://flow.org/en/docs/types/modules/ | ||
[sort-from]: README.md#why-sort-on-from | ||
[typescript]: https://www.typescriptlang.org/ | ||
<!-- prettier-ignore-end --> |
{ | ||
"name": "eslint-plugin-simple-import-sort", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"license": "MIT", | ||
@@ -26,3 +26,3 @@ "author": "Simon Lydell", | ||
"eslint:fix": "npm run eslint -- --fix", | ||
"eslint:examples": "eslint --rulesdir src --no-ignore --fix-dry-run --format json --report-unused-disable-directives examples", | ||
"eslint:examples": "eslint --rulesdir src --no-ignore --fix-dry-run --format json --report-unused-disable-directives examples --ext .js,.ts", | ||
"prettier": "prettier --write \"*.md\"", | ||
@@ -36,12 +36,14 @@ "doctoc": "doctoc README.md", | ||
"devDependencies": { | ||
"@typescript-eslint/parser": "1.1.0", | ||
"babel-eslint": "10.0.1", | ||
"cross-spawn": "6.0.5", | ||
"doctoc": "1.4.0", | ||
"eslint": "5.9.0", | ||
"eslint": "5.12.1", | ||
"eslint-config-lydell": "12.0.0", | ||
"eslint-plugin-import": "2.14.0", | ||
"eslint-plugin-jest": "22.1.0", | ||
"eslint-plugin-prettier": "3.0.0", | ||
"jest": "23.6.0", | ||
"prettier": "1.15.3" | ||
"eslint-plugin-import": "2.15.0", | ||
"eslint-plugin-jest": "22.1.3", | ||
"eslint-plugin-prettier": "3.0.1", | ||
"jest": "24.0.0", | ||
"prettier": "1.16.1", | ||
"typescript": "3.2.4" | ||
}, | ||
@@ -48,0 +50,0 @@ "peerDependencies": { |
@@ -7,4 +7,5 @@ # eslint-plugin-simple-import-sort [![Build Status][travis-badge]][travis-link] | ||
- ✔️ Handles comments | ||
- ✔️ Handles [Flow type imports] | ||
- ✔️ Handles [Flow type imports] \(via [babel-eslint]) | ||
- ✔️ Handles [webpack loader syntax] | ||
- ✔️ [TypeScript] friendly \(via [@typescript-eslint/parser]) | ||
- ✔️ [Prettier] friendly | ||
@@ -520,3 +521,5 @@ - ✔️ [eslint-plugin-import] friendly | ||
<!-- prettier-ignore-start --> | ||
[@typescript-eslint/parser]: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser | ||
[array-sort]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort | ||
[babel-eslint]: https://github.com/babel/babel-eslint | ||
[comment-handling]: #comment-and-whitespace-handling | ||
@@ -547,3 +550,4 @@ [doctoc]: https://github.com/thlorenz/doctoc/ | ||
[travis-link]: https://travis-ci.com/lydell/eslint-plugin-simple-import-sort | ||
[typescript]: https://www.typescriptlang.org/ | ||
[webpack loader syntax]: https://webpack.js.org/concepts/loaders/#inline | ||
<!-- prettier-ignore-end --> |
@@ -167,4 +167,4 @@ "use strict"; | ||
const all = [...commentsBefore, importNode, ...commentsAfter]; | ||
const { start } = all[0]; | ||
const { end } = all[all.length - 1]; | ||
const [start] = all[0].range; | ||
const [, end] = all[all.length - 1].range; | ||
@@ -586,3 +586,3 @@ const { group, source } = getGroupAndSource(importNode); | ||
...parseWhitespace( | ||
sourceCode.text.slice(previous.end, comment.start) | ||
sourceCode.text.slice(previous.range[1], comment.range[0]) | ||
), | ||
@@ -592,3 +592,5 @@ Object.assign({}, comment, { code: sourceCode.getText(comment) }), | ||
}), | ||
...parseWhitespace(sourceCode.text.slice(last.end, nextToken.start)), | ||
...parseWhitespace( | ||
sourceCode.text.slice(last.range[1], nextToken.range[0]) | ||
), | ||
]; | ||
@@ -613,3 +615,3 @@ }); | ||
sourceCode.getText(comment) + | ||
removeBlankLines(sourceCode.text.slice(comment.end, next.start)) | ||
removeBlankLines(sourceCode.text.slice(comment.range[1], next.range[0])) | ||
); | ||
@@ -627,4 +629,5 @@ }) | ||
return ( | ||
removeBlankLines(sourceCode.text.slice(previous.end, comment.start)) + | ||
sourceCode.getText(comment) | ||
removeBlankLines( | ||
sourceCode.text.slice(previous.range[1], comment.range[0]) | ||
) + sourceCode.getText(comment) | ||
); | ||
@@ -631,0 +634,0 @@ }) |
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
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
44147
677
551
12