Skip to content

Commit

Permalink
refactor: update deps and refactor condition
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Dec 28, 2023
1 parent 0a3926c commit 87a1f1b
Show file tree
Hide file tree
Showing 3 changed files with 2,001 additions and 3,231 deletions.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@
"textlintrule"
],
"devDependencies": {
"lint-staged": "^10.5.4",
"prettier": "^2.2.1",
"textlint-scripts": "^3.0.0"
"lint-staged": "^15.2.0",
"prettier": "^3.1.1",
"textlint-scripts": "^13.4.1"
},
"dependencies": {
"analyze-desumasu-dearu": "^5.0.0",
"textlint-rule-helper": "^2.0.0",
"unist-util-visit": "^3.0.0"
"analyze-desumasu-dearu": "^5.0.1",
"textlint-rule-helper": "^2.3.1"
},
"prettier": {
"singleQuote": false,
Expand Down
12 changes: 7 additions & 5 deletions src/MixedChecker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// LICENSE : MIT
"use strict";
import { analyze, isDearu, isDesumasu } from "analyze-desumasu-dearu";

export default class MixedChecker {
/**
* @param context
Expand Down Expand Up @@ -82,11 +83,12 @@ export default class MixedChecker {
}

isOver() {
return (
(this.options.preferDesumasu && this.dearuCount !== 0) ||
(this.options.preferDearu && this.desumasuCount !== 0) ||
(this.dearuCount !== 0 && this.desumasuCount !== 0)
);
if (this.options.preferDesumasu) {
return this.dearuCount !== 0;
} else if (this.options.preferDearu) {
return this.desumasuCount !== 0;
}
return this.dearuCount !== 0 && this.desumasuCount !== 0;
}

/**
Expand Down
Loading

0 comments on commit 87a1f1b

Please sign in to comment.