init
This commit is contained in:
commit
082ce51153
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
node_modules/
|
11
.textlintrc.json
Normal file
11
.textlintrc.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"plugins": {},
|
||||||
|
"filters": {
|
||||||
|
"allowlist": true,
|
||||||
|
"comments": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"preset-ja-technical-writing": true,
|
||||||
|
"textlint-rule-zen-entry": true
|
||||||
|
}
|
||||||
|
}
|
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"editor.wordWrap": "on"
|
||||||
|
}
|
12
README.md
Normal file
12
README.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
## ⼊学選考
|
||||||
|
※全⾓・半⾓問わず1文字としてカウントされます。※改⾏は1文字としてカウントされます。※改⾏は10回までとしてください。※同じ文字の連続は最大3回までとしてください。※その他入⼒に
|
||||||
|
あたってはこのシステムのルールに従ってください。
|
||||||
|
本学では、Web出願時に⼊力する「志望理由・⼩論⽂」による⼊学選考を⾏います。
|
||||||
|
Web出願時の指⽰に従い、「志望理由・⼩論⽂」の⼊力を⾏ってください。
|
||||||
|
### 志望理由
|
||||||
|
下記の志望理由2問について、それぞれ50字以上400字以内で記載をしてください。
|
||||||
|
志望理由1:「⾃⼰分析(⾃⾝の強み弱みを分析)」/志望理由2:「ZEN大学を志望する理由」
|
||||||
|
### ⼩論⽂
|
||||||
|
本学での学びや取り組みを通じて、在学中や卒業後に社会とどのように関わりたいかについて、下記の⼩論⽂2問について、
|
||||||
|
それぞれ50字以上400字以内で記載をしてください。
|
||||||
|
⼩論⽂1:「⼊学後に学びたいこと」/⼩論⽂2:「将来(主に卒業後)にやりたいこと」
|
20
package.json
Normal file
20
package.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "syoronbun",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"lint": "textlint src/**/*.txt"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"textlint": "^14.3.0",
|
||||||
|
"textlint-filter-rule-allowlist": "^4.0.0",
|
||||||
|
"textlint-filter-rule-comments": "^1.2.2",
|
||||||
|
"textlint-rule-preset-ja-technical-writing": "^10.0.1",
|
||||||
|
"textlint-rule-zen-entry": "link:textlint-rules\\textlint-rule-zen-entry"
|
||||||
|
}
|
||||||
|
}
|
2774
pnpm-lock.yaml
generated
Normal file
2774
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
0
src/小論文/⼊学後に学びたいこと.txt
Normal file
0
src/小論文/⼊学後に学びたいこと.txt
Normal file
0
src/小論文/将来(主に卒業後)にやりたいこと.txt
Normal file
0
src/小論文/将来(主に卒業後)にやりたいこと.txt
Normal file
0
src/志望理由/ZEN大学を志望する理由.txt
Normal file
0
src/志望理由/ZEN大学を志望する理由.txt
Normal file
0
src/志望理由/⾃⼰分析(⾃⾝の強み弱みを分析).txt
Normal file
0
src/志望理由/⾃⼰分析(⾃⾝の強み弱みを分析).txt
Normal file
35
textlint-rules/textlint-rule-zen-entry/.gitignore
vendored
Normal file
35
textlint-rules/textlint-rule-zen-entry/.gitignore
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
### https://raw.github.com/github/gitignore/608690d6b9a78c2a003affc792e49a84905b3118/Node.gitignore
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage
|
||||||
|
|
||||||
|
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directory
|
||||||
|
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# Debug log from npm
|
||||||
|
npm-debug.log
|
||||||
|
|
||||||
|
# Publish src/ instead lib/
|
||||||
|
/lib
|
45
textlint-rules/textlint-rule-zen-entry/README.md
Normal file
45
textlint-rules/textlint-rule-zen-entry/README.md
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# textlint-rule-zen-entry
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Install with [npm](https://www.npmjs.com/):
|
||||||
|
|
||||||
|
npm install textlint-rule-zen-entry
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Via `.textlintrc.json`(Recommended)
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"rules": {
|
||||||
|
"zen-entry": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Via CLI
|
||||||
|
|
||||||
|
```
|
||||||
|
textlint --rule zen-entry README.md
|
||||||
|
```
|
||||||
|
|
||||||
|
### Build
|
||||||
|
|
||||||
|
Builds source codes for publish to the `lib` folder.
|
||||||
|
You can write ES2015+ source codes in `src/` folder.
|
||||||
|
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
### Tests
|
||||||
|
|
||||||
|
Run test code in `test` folder.
|
||||||
|
Test textlint rule by [textlint-tester](https://github.com/textlint/textlint-tester).
|
||||||
|
|
||||||
|
npm test
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
ISC ©
|
7768
textlint-rules/textlint-rule-zen-entry/package-lock.json
generated
Normal file
7768
textlint-rules/textlint-rule-zen-entry/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
28
textlint-rules/textlint-rule-zen-entry/package.json
Normal file
28
textlint-rules/textlint-rule-zen-entry/package.json
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"version": "1.0.0",
|
||||||
|
"keywords": [
|
||||||
|
"textlintrule"
|
||||||
|
],
|
||||||
|
"main": "lib/index.js",
|
||||||
|
"files": [
|
||||||
|
"lib/",
|
||||||
|
"src/"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"test": "textlint-scripts test",
|
||||||
|
"build": "textlint-scripts build",
|
||||||
|
"prepublish": "npm run --if-present build"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@textlint/types": "^14.3.0",
|
||||||
|
"textlint-scripts": "^14.3.0",
|
||||||
|
"textlint-tester": "^14.3.0"
|
||||||
|
},
|
||||||
|
"name": "textlint-rule-zen-entry",
|
||||||
|
"directories": {
|
||||||
|
"test": "test"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"description": ""
|
||||||
|
}
|
50
textlint-rules/textlint-rule-zen-entry/src/index.js
Normal file
50
textlint-rules/textlint-rule-zen-entry/src/index.js
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
/**
|
||||||
|
* @param {import("@textlint/types").TextlintRuleContext} context
|
||||||
|
* @param {import("@textlint/types").TextlintRuleOptions<{ allows?: string[]}>} options
|
||||||
|
* @returns {import("@textlint/types").TextlintRuleCreator}
|
||||||
|
*/
|
||||||
|
export default function (context, options = {}) {
|
||||||
|
const { Syntax, RuleError, report, getSource, locator } = context;
|
||||||
|
const allows = options.allows ?? [];
|
||||||
|
return {
|
||||||
|
[Syntax.Document](node) { // "Document" node
|
||||||
|
const text = getSource(node); // Get text
|
||||||
|
if (allows.some(allow => text.includes(allow))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Max line bleak is 10
|
||||||
|
const lines = text.split("\n").length
|
||||||
|
if (lines > 10) {
|
||||||
|
const ruleError = new RuleError(`Too many lines. (${lines} lines)`, {
|
||||||
|
index: 0
|
||||||
|
});
|
||||||
|
report(node, ruleError);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Min length is 50
|
||||||
|
if (text.length < 50) {
|
||||||
|
const ruleError = new RuleError(`Too short. (${text.length} characters)`, {
|
||||||
|
index: 0
|
||||||
|
});
|
||||||
|
report(node, ruleError);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Max length is 400
|
||||||
|
if (text.length > 400) {
|
||||||
|
const ruleError = new RuleError(`Too long. (${text.length} characters)`, {
|
||||||
|
index: 0
|
||||||
|
});
|
||||||
|
report(node, ruleError);
|
||||||
|
}
|
||||||
|
|
||||||
|
// warn length is 340
|
||||||
|
if (text.length < 340) {
|
||||||
|
const ruleError = new RuleError(`Few short (${text.length} characters)`, {
|
||||||
|
index: 0
|
||||||
|
});
|
||||||
|
report(node, ruleError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
46
textlint-rules/textlint-rule-zen-entry/test/index-test.js
Normal file
46
textlint-rules/textlint-rule-zen-entry/test/index-test.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import TextLintTester from "textlint-tester";
|
||||||
|
import rule from "../src/index";
|
||||||
|
|
||||||
|
const tester = new TextLintTester();
|
||||||
|
// ruleName, rule, { valid, invalid }
|
||||||
|
tester.run("rule", rule, {
|
||||||
|
valid: [
|
||||||
|
// no problem
|
||||||
|
"text",
|
||||||
|
{
|
||||||
|
text: "It is bugs, but it should be ignored",
|
||||||
|
options: {
|
||||||
|
allows: ["it should be ignored"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
invalid: [
|
||||||
|
// single match
|
||||||
|
{
|
||||||
|
text: "It is bugs.",
|
||||||
|
errors: [
|
||||||
|
{
|
||||||
|
message: "Found bugs.",
|
||||||
|
range: [6, 10]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// multiple match
|
||||||
|
{
|
||||||
|
text: `It has many bugs.
|
||||||
|
|
||||||
|
One more bugs`,
|
||||||
|
errors: [
|
||||||
|
{
|
||||||
|
message: "Found bugs.",
|
||||||
|
range: [12, 16]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
message: "Found bugs.",
|
||||||
|
range: [28, 32]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user