Skip to content

Commit

Permalink
Merge branch 'release/0.4.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
hiukky committed Feb 12, 2022
2 parents b560a4e + dd618ba commit 6c8ad30
Show file tree
Hide file tree
Showing 4 changed files with 573 additions and 539 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<img alt="GitHub license" src="https://img.shields.io/github/license/hiukky/eslint-plugin-hooks?color=0d1117&style=for-the-badge&colorA=1C1D27" />
</a>
<a href="https://www.npmjs.com/package/eslint-plugin-hooks">
<img alt="NPM" src="https://img.shields.io/npm/dt/eslint-plugin-hooks-sort?color=0d1117&style=for-the-badge&colorA=1C1D27" />
<img alt="NPM" src="https://img.shields.io/npm/dt/eslint-plugin-hooks?color=0d1117&style=for-the-badge&colorA=1C1D27" />
</a>
</p>

<h3 align="center"> A simple organizer for ordering hooks. </h3>

<p align="center">
<sub>Built with ❤︎ by <a href="https://hiukky.com">Hiukky</a>
<sub>Built with ❤︎ by <a href="https://hiukky.com">hiukky</a>
<br/>
</p>

Expand Down
5 changes: 3 additions & 2 deletions lib/rules/sort/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module.exports = {
? [type, init]
: []) as [Node['type'], Node],
)
.filter(node => node.length)
.filter(node => node.length === 2)
.map(([type, declaration]) => {
switch (type) {
case 'MemberExpression':
Expand All @@ -112,7 +112,8 @@ module.exports = {
.filter(Boolean)
.filter(
hook =>
hook.name?.slice(0, 3) === 'use' && groups.includes(hook.name),
hook.name?.slice(0, 3) === 'use' &&
groups.includes(hook.name),
)

const correctOrdering: Node[] = [...hooks].sort(
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-hooks",
"version": "0.4.1",
"version": "0.4.2",
"description": "A simple organizer for ordering hooks.",
"main": "dist/index.js",
"repository": {
Expand Down Expand Up @@ -29,26 +29,26 @@
"requireindex": "~1.2.0"
},
"devDependencies": {
"@commitlint/cli": "^13.2.1",
"@commitlint/config-conventional": "^13.2.0",
"@types/chai": "^4.2.22",
"@types/eslint": "^7.28.1",
"@types/mocha": "^9.0.0",
"@types/node": "^16.10.3",
"@types/react": "^17.0.27",
"@commitlint/cli": "^16.1.0",
"@commitlint/config-conventional": "^16.0.0",
"@types/chai": "^4.3.0",
"@types/eslint": "^8.4.1",
"@types/mocha": "^9.1.0",
"@types/node": "^17.0.17",
"@types/react": "^17.0.39",
"@types/requireindex": "^1.2.0",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
"husky": "^7.0.2",
"mocha": "^9.1.2",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"eslint": "^8.9.0",
"eslint-config-airbnb-base": "^15.0.0",
"husky": "^7.0.4",
"mocha": "^9.2.0",
"pinst": "^2.1.6",
"prettier": "^2.4.1",
"prettier": "^2.5.1",
"react": "^17.0.2",
"rimraf": "^3.0.2",
"ts-node": "^10.2.1",
"tsconfig-paths": "^3.11.0",
"typescript": "^4.4.3"
"ts-node": "^10.5.0",
"tsconfig-paths": "^3.12.0",
"typescript": "^4.5.5"
},
"engines": {
"node": ">=0.10.0"
Expand Down
Loading

0 comments on commit 6c8ad30

Please sign in to comment.