Skip to content

Commit cc84c17

Browse files
committed
Add custom textlint rule file under textfile dir
1 parent 0e8d93b commit cc84c17

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"format:source": "prettier --config .prettierrc --write \"{gatsby-*.js,{flow-typed,plugins,src}/**/*.js}\"",
8080
"format:examples": "prettier --config examples/.prettierrc --write \"examples/**/*.js\"",
8181
"lint": "eslint .",
82-
"lint:text": "textlint content/{docs,home,tutorial,warnings}/*.md",
82+
"lint:text": "textlint --rulesdir=./textlint content/{docs,home,tutorial,warnings}/*.md",
8383
"netlify": "yarn --version && rimraf node_modules && yarn install --frozen-lockfile --check-files && yarn build",
8484
"nit:source": "prettier --config .prettierrc --list-different \"{gatsby-*.js,{flow-typed,plugins,src}/**/*.js}\"",
8585
"nit:examples": "prettier --config examples/.prettierrc --list-different \"examples/**/*.js\"",

textlint/jp-reactjs-org-lint.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @param {RuleContext} context
3+
*/
4+
module.exports = context => {
5+
return {
6+
[context.Syntax.Str]: node => {
7+
const text = context.getSource(node);
8+
const match = //.exec(text);
9+
if (match) {
10+
context.report(
11+
node,
12+
new context.RuleError(
13+
`「下さい」の代わりに「ください」を使ってください。`,
14+
),
15+
);
16+
}
17+
},
18+
};
19+
};

0 commit comments

Comments
 (0)