@anolilab/textlint-config 4.2.2 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -1
- package/README.md +140 -141
- package/dist/postinstall.d.ts +1 -0
- package/dist/postinstall.js +149 -0
- package/dist/postinstall.js.map +1 -0
- package/dist/postinstall.mjs +147 -0
- package/dist/postinstall.mjs.map +1 -0
- package/package.json +28 -41
- package/lib/postinstall.js +0 -218
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## @anolilab/textlint-config [5.0.1](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/textlint-config@5.0.0...@anolilab/textlint-config@5.0.1) (2023-06-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* changed lib from js to ts ([9ffbaae](https://github.com/anolilab/javascript-style-guide/commit/9ffbaaee395c9f5345adcd97cb8c3c2e77af86eb))
|
|
7
|
+
|
|
8
|
+
## @anolilab/textlint-config [5.0.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/textlint-config@4.2.2...@anolilab/textlint-config@5.0.0) (2023-06-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### ⚠ BREAKING CHANGES
|
|
12
|
+
|
|
13
|
+
* Changed the package to support cjs and mjs, so the type module was removed
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* switched js to ts, created a new package-utils package ([5477591](https://github.com/anolilab/javascript-style-guide/commit/5477591aa46d878b8535ff8503384e27ca537a7f))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Dependencies
|
|
22
|
+
|
|
23
|
+
* **@anolilab/semantic-release-preset:** upgraded to 3.0.0
|
|
24
|
+
|
|
1
25
|
## @anolilab/textlint-config [4.2.2](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/textlint-config@4.2.1...@anolilab/textlint-config@4.2.2) (2023-05-26)
|
|
2
26
|
|
|
3
27
|
|
|
@@ -323,7 +347,7 @@ Signed-off-by: prisis <d.bannert@anolilab.de>
|
|
|
323
347
|
|
|
324
348
|
### Bug Fixes
|
|
325
349
|
|
|
326
|
-
- removed index.
|
|
350
|
+
- removed index.ts from text-lint ([e5ab6d6](https://github.com/anolilab/javascript-style-guide/commit/e5ab6d6a9214b288646d471e19afff163ac5cf57))
|
|
327
351
|
|
|
328
352
|
### @anolilab/textlint-config [2.0.2](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/textlint-config@2.0.1...@anolilab/textlint-config@2.0.2) (2021-05-04)
|
|
329
353
|
|
package/README.md
CHANGED
|
@@ -20,157 +20,156 @@ Anolilab Coding Standard for text linting.
|
|
|
20
20
|
npm install --dev-save @anolilab/textlint-config textlint
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
```sh
|
|
24
|
+
$ yarn add -D @anolilab/textlint-config textlint
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
$ pnpm add -D @anolilab/textlint-config textlint
|
|
29
|
+
```
|
|
30
|
+
|
|
23
31
|
## Usage
|
|
24
32
|
|
|
25
33
|
If you don’t have a `.textlintrc`, we will create the file for you after installing `@anolilab/textlint-config`.
|
|
26
34
|
|
|
27
35
|
If you already have a `.textlintrc`, then you can extend the `.textlintrc`, with `@anolilab/textlint-config`.
|
|
28
36
|
|
|
29
|
-
```
|
|
37
|
+
```json5
|
|
30
38
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
"rules": {
|
|
35
|
-
"en-capitalization": true,
|
|
36
|
-
"footnote-order": true,
|
|
37
|
-
"no-todo": true,
|
|
38
|
-
"no-dead-link": {
|
|
39
|
-
"ignore": [
|
|
40
|
-
"bc_data_*",
|
|
41
|
-
]
|
|
42
|
-
},
|
|
43
|
-
"no-empty-section": true,
|
|
44
|
-
"terminology": true,
|
|
45
|
-
"apostrophe": true,
|
|
46
|
-
"diacritics": true,
|
|
47
|
-
"@textlint-rule/no-invalid-control-character": true,
|
|
48
|
-
"@textlint-rule/no-unmatched-pair": true,
|
|
49
|
-
"abbr-within-parentheses": true,
|
|
50
|
-
"alex": {
|
|
51
|
-
"allow": [
|
|
52
|
-
"period",
|
|
53
|
-
"european",
|
|
54
|
-
"failure",
|
|
55
|
-
"fore",
|
|
56
|
-
"attack",
|
|
57
|
-
"execution",
|
|
58
|
-
"executed",
|
|
59
|
-
"remain",
|
|
60
|
-
"execute"
|
|
61
|
-
]
|
|
39
|
+
"@textlint/markdown": {
|
|
40
|
+
"extensions": [".md", ".mdx"]
|
|
62
41
|
},
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
"passive": false,
|
|
66
|
-
"eprime": false,
|
|
42
|
+
"filters": {
|
|
43
|
+
"comments": true
|
|
67
44
|
},
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
45
|
+
"rules": {
|
|
46
|
+
"en-capitalization": true,
|
|
47
|
+
"footnote-order": true,
|
|
48
|
+
"no-todo": true,
|
|
49
|
+
"no-dead-link": {
|
|
50
|
+
"ignore": ["bc_data_*"]
|
|
51
|
+
},
|
|
52
|
+
"no-empty-section": true,
|
|
53
|
+
"terminology": true,
|
|
54
|
+
"apostrophe": true,
|
|
55
|
+
"diacritics": true,
|
|
56
|
+
"@textlint-rule/no-invalid-control-character": true,
|
|
57
|
+
"@textlint-rule/no-unmatched-pair": true,
|
|
58
|
+
"abbr-within-parentheses": true,
|
|
59
|
+
"alex": {
|
|
60
|
+
"allow": ["period", "european", "failure", "fore", "attack", "execution", "executed", "remain", "execute"]
|
|
61
|
+
},
|
|
62
|
+
"@textlint-rule/preset-google": true,
|
|
63
|
+
"write-good": {
|
|
64
|
+
"passive": false,
|
|
65
|
+
"eprime": false
|
|
66
|
+
},
|
|
67
|
+
"common-misspellings": true,
|
|
68
|
+
"terminology": {
|
|
69
|
+
"defaultTerms": false,
|
|
70
|
+
"terms": [
|
|
71
|
+
// Abbreviations
|
|
72
|
+
"API",
|
|
73
|
+
["API['’]?s", "APIs"],
|
|
74
|
+
"Ajax",
|
|
75
|
+
"CLI",
|
|
76
|
+
"CSS",
|
|
77
|
+
"CORS",
|
|
78
|
+
["^E2E", "E2E"],
|
|
79
|
+
"gif",
|
|
80
|
+
["^HTML", "HTML"],
|
|
81
|
+
["^URL(s?)", "URL$1"],
|
|
82
|
+
["^HTTP", "HTTP"],
|
|
83
|
+
["^HTTPS", "HTTPS"],
|
|
84
|
+
"SSO",
|
|
85
|
+
["^XHR(s?)", "XHR$1"],
|
|
86
|
+
["^XHR['’]?s", "XHRs"],
|
|
87
|
+
"Xvfb",
|
|
88
|
+
"YAML",
|
|
89
|
+
|
|
90
|
+
// Words and phrases
|
|
91
|
+
["\\(s\\)he", "they"],
|
|
92
|
+
["he or she", "they"],
|
|
93
|
+
["he/she", "they"],
|
|
94
|
+
["crazy", "complex"],
|
|
95
|
+
["crazier", "more complex"],
|
|
96
|
+
["craziest", "most complex"],
|
|
97
|
+
["dumb", "unintended"],
|
|
98
|
+
["insane", "outrageous"],
|
|
99
|
+
|
|
100
|
+
// Prefer American spelling
|
|
101
|
+
["behaviour", "behavior"],
|
|
102
|
+
["cancelled", "canceled"],
|
|
103
|
+
["cancelling", "canceling"],
|
|
104
|
+
["centre", "center"],
|
|
105
|
+
["colour", "color"],
|
|
106
|
+
["customise", "customize"],
|
|
107
|
+
["customisation", "customization"],
|
|
108
|
+
["favourite", "favorite"],
|
|
109
|
+
["labelled", "labeled"],
|
|
110
|
+
["licence", "license"],
|
|
111
|
+
["organise", "organize"],
|
|
112
|
+
|
|
113
|
+
// Common misspellings
|
|
114
|
+
["gaurantee", "guarantee"],
|
|
115
|
+
|
|
116
|
+
// Words we would like to not use altogether
|
|
117
|
+
["simply", ""],
|
|
118
|
+
|
|
119
|
+
// Single word
|
|
120
|
+
["change[- ]log(s?)", "changelog$1"],
|
|
121
|
+
["code[- ]base(es?)", "codebase$1"],
|
|
122
|
+
["e[- ]mail(s?)", "email$1"],
|
|
123
|
+
["end[- ]point(s?)", "endpoint$1"],
|
|
124
|
+
["file[- ]name(s?)", "filename$1"],
|
|
125
|
+
["can[- ]not", "cannot$1"],
|
|
126
|
+
|
|
127
|
+
// Multiple words
|
|
128
|
+
["back-?end(s?)", "back end$1"],
|
|
129
|
+
["front-?end(s?)", "front end$1"],
|
|
130
|
+
["full-?stack(s?)", "full stack$1"],
|
|
131
|
+
["open-?source(ed?)", "open source$1"],
|
|
132
|
+
["web-?page(s?)", "web page$1"],
|
|
133
|
+
|
|
134
|
+
// Hyphenated
|
|
135
|
+
["end ?to ?end", "end-to-end"],
|
|
136
|
+
["retryability", "retry-ability"],
|
|
137
|
+
["retriability", "retry-ability"],
|
|
138
|
+
|
|
139
|
+
["some", ""],
|
|
140
|
+
["filetype", "file type"],
|
|
141
|
+
["stylesheet", "style sheet"],
|
|
142
|
+
["like this", ""],
|
|
143
|
+
["probably", ""],
|
|
144
|
+
["known as", ""],
|
|
145
|
+
["really", ""],
|
|
146
|
+
["just", ""],
|
|
147
|
+
["simple", ""],
|
|
148
|
+
["obvious", ""],
|
|
149
|
+
["straightforward", ""],
|
|
150
|
+
["very", ""],
|
|
151
|
+
["a little", ""],
|
|
152
|
+
["note that", ""],
|
|
153
|
+
["good to note", ""],
|
|
154
|
+
["good to remember", ""],
|
|
155
|
+
["basically", ""],
|
|
156
|
+
["actually", ""],
|
|
157
|
+
["pretty", ""],
|
|
158
|
+
["easy", ""],
|
|
159
|
+
["interesting", ""],
|
|
160
|
+
["way to", ""],
|
|
161
|
+
["In order to", "To"],
|
|
162
|
+
["in order to", "to"],
|
|
163
|
+
["might", ""],
|
|
164
|
+
["us", ""],
|
|
165
|
+
["I'll", ""],
|
|
166
|
+
["I've", ""],
|
|
167
|
+
["they'll", ""],
|
|
168
|
+
["it is", "it's"],
|
|
169
|
+
["It is", "It's"]
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
172
|
}
|
|
173
|
-
}
|
|
174
173
|
}
|
|
175
174
|
```
|
|
176
175
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var fs = require('fs');
|
|
5
|
+
var path = require('path');
|
|
6
|
+
var util = require('util');
|
|
7
|
+
|
|
8
|
+
process.env.CI&&process.exit(0);var i=util.promisify(fs.writeFile),o=path.resolve(process.cwd(),"..","..","..");console.log("Configuring @anolilab/textlint-config",o,`
|
|
9
|
+
`);var c=()=>{let e=path.join(o,".textlintrc"),t=`{
|
|
10
|
+
"@textlint/markdown": {
|
|
11
|
+
"extensions": [".md", ".mdx"]
|
|
12
|
+
},
|
|
13
|
+
"filters": {
|
|
14
|
+
"comments": true
|
|
15
|
+
},
|
|
16
|
+
"rules": {
|
|
17
|
+
"en-capitalization": true,
|
|
18
|
+
"footnote-order": true,
|
|
19
|
+
"no-todo": true,
|
|
20
|
+
"no-dead-link": {
|
|
21
|
+
"ignore": ["bc_data_*"]
|
|
22
|
+
},
|
|
23
|
+
"no-empty-section": true,
|
|
24
|
+
"terminology": true,
|
|
25
|
+
"apostrophe": true,
|
|
26
|
+
"diacritics": true,
|
|
27
|
+
"@textlint-rule/no-invalid-control-character": true,
|
|
28
|
+
"@textlint-rule/no-unmatched-pair": true,
|
|
29
|
+
"abbr-within-parentheses": true,
|
|
30
|
+
"alex": {
|
|
31
|
+
"allow": ["period", "european", "failure", "fore", "attack", "execution", "executed", "remain", "execute"]
|
|
32
|
+
},
|
|
33
|
+
"@textlint-rule/preset-google": true,
|
|
34
|
+
"write-good": {
|
|
35
|
+
"passive": false,
|
|
36
|
+
"eprime": false
|
|
37
|
+
},
|
|
38
|
+
"common-misspellings": true,
|
|
39
|
+
"terminology": {
|
|
40
|
+
"defaultTerms": false,
|
|
41
|
+
"terms": [
|
|
42
|
+
// Abbreviations
|
|
43
|
+
"API",
|
|
44
|
+
["API['\u2019]?s", "APIs"],
|
|
45
|
+
"Ajax",
|
|
46
|
+
"CLI",
|
|
47
|
+
"CSS",
|
|
48
|
+
"CORS",
|
|
49
|
+
["^E2E", "E2E"],
|
|
50
|
+
"gif",
|
|
51
|
+
["^HTML", "HTML"],
|
|
52
|
+
["^URL(s?)", "URL$1"],
|
|
53
|
+
["^HTTP", "HTTP"],
|
|
54
|
+
["^HTTPS", "HTTPS"],
|
|
55
|
+
"SSO",
|
|
56
|
+
["^XHR(s?)", "XHR$1"],
|
|
57
|
+
["^XHR['\u2019]?s", "XHRs"],
|
|
58
|
+
"Xvfb",
|
|
59
|
+
"YAML",
|
|
60
|
+
|
|
61
|
+
// Words and phrases
|
|
62
|
+
["\\(s\\)he", "they"],
|
|
63
|
+
["he or she", "they"],
|
|
64
|
+
["he/she", "they"],
|
|
65
|
+
["crazy", "complex"],
|
|
66
|
+
["crazier", "more complex"],
|
|
67
|
+
["craziest", "most complex"],
|
|
68
|
+
["dumb", "unintended"],
|
|
69
|
+
["insane", "outrageous"],
|
|
70
|
+
|
|
71
|
+
// Prefer American spelling
|
|
72
|
+
["behaviour", "behavior"],
|
|
73
|
+
["cancelled", "canceled"],
|
|
74
|
+
["cancelling", "canceling"],
|
|
75
|
+
["centre", "center"],
|
|
76
|
+
["colour", "color"],
|
|
77
|
+
["customise", "customize"],
|
|
78
|
+
["customisation", "customization"],
|
|
79
|
+
["favourite", "favorite"],
|
|
80
|
+
["labelled", "labeled"],
|
|
81
|
+
["licence", "license"],
|
|
82
|
+
["organise", "organize"],
|
|
83
|
+
|
|
84
|
+
// Common misspellings
|
|
85
|
+
["gaurantee", "guarantee"],
|
|
86
|
+
|
|
87
|
+
// Words we would like to not use altogether
|
|
88
|
+
["simply", ""],
|
|
89
|
+
|
|
90
|
+
// Single word
|
|
91
|
+
["change[- ]log(s?)", "changelog$1"],
|
|
92
|
+
["code[- ]base(es?)", "codebase$1"],
|
|
93
|
+
["e[- ]mail(s?)", "email$1"],
|
|
94
|
+
["end[- ]point(s?)", "endpoint$1"],
|
|
95
|
+
["file[- ]name(s?)", "filename$1"],
|
|
96
|
+
["can[- ]not", "cannot$1"],
|
|
97
|
+
|
|
98
|
+
// Multiple words
|
|
99
|
+
["back-?end(s?)", "back end$1"],
|
|
100
|
+
["front-?end(s?)", "front end$1"],
|
|
101
|
+
["full-?stack(s?)", "full stack$1"],
|
|
102
|
+
["open-?source(ed?)", "open source$1"],
|
|
103
|
+
["web-?page(s?)", "web page$1"],
|
|
104
|
+
|
|
105
|
+
// Hyphenated
|
|
106
|
+
["end ?to ?end", "end-to-end"],
|
|
107
|
+
["retryability", "retry-ability"],
|
|
108
|
+
["retriability", "retry-ability"],
|
|
109
|
+
|
|
110
|
+
["some", ""],
|
|
111
|
+
["filetype", "file type"],
|
|
112
|
+
["stylesheet", "style sheet"],
|
|
113
|
+
["like this", ""],
|
|
114
|
+
["probably", ""],
|
|
115
|
+
["known as", ""],
|
|
116
|
+
["really", ""],
|
|
117
|
+
["just", ""],
|
|
118
|
+
["simple", ""],
|
|
119
|
+
["obvious", ""],
|
|
120
|
+
["straightforward", ""],
|
|
121
|
+
["very", ""],
|
|
122
|
+
["a little", ""],
|
|
123
|
+
["note that", ""],
|
|
124
|
+
["good to note", ""],
|
|
125
|
+
["good to remember", ""],
|
|
126
|
+
["basically", ""],
|
|
127
|
+
["actually", ""],
|
|
128
|
+
["pretty", ""],
|
|
129
|
+
["easy", ""],
|
|
130
|
+
["interesting", ""],
|
|
131
|
+
["way to", ""],
|
|
132
|
+
["In order to", "To"],
|
|
133
|
+
["in order to", "to"],
|
|
134
|
+
["might", ""],
|
|
135
|
+
["us", ""],
|
|
136
|
+
["I'll", ""],
|
|
137
|
+
["I've", ""],
|
|
138
|
+
["they'll", ""],
|
|
139
|
+
["it is", "it's"],
|
|
140
|
+
["It is", "It's"]
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
`;return fs.existsSync(e)?(console.warn(`\u26A0\uFE0F .textlintrc already exists;
|
|
146
|
+
Make sure that it includes the following for @anolilab/textlint-config'
|
|
147
|
+
to work as it should: ${t}.`),Promise.resolve()):i(e,t,"utf-8")},u=()=>{let e=path.join(o,".textlintignore"),t="";return fs.existsSync(e)?(console.warn("\u26A0\uFE0F .textlintignore already exists;"),Promise.resolve()):i(e,t,"utf-8")};(async()=>{try{await c(),await u(),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(e){console.log("\u{1F62C} something went wrong:"),console.error(e),process.exit(1);}})();
|
|
148
|
+
//# sourceMappingURL=out.js.map
|
|
149
|
+
//# sourceMappingURL=postinstall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/postinstall.ts"],"names":["existsSync","writeFile","join","resolve","promisify","writeFileAsync","projectPath","writeTextLintRc","filePath","content","writeTextLintIgnore","error"],"mappings":";AAEA,OAAS,cAAAA,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,EAAM,WAAAC,MAAe,OAC9B,OAAS,aAAAC,MAAiB,OAEtB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUH,CAAS,EAIpCK,EAAcH,EAAQ,QAAQ,IAAI,EAAG,KAAM,KAAM,IAAI,EAE3D,QAAQ,IAAI,wCAAyCG,EAAa;AAAA,CAAI,EAKtE,IAAMC,EAAkB,IAAM,CAC1B,IAAMC,EAAWN,EAAKI,EAAa,aAAa,EAC1CG,EAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0IhB,OAAIT,EAAWQ,CAAQ,GACnB,QAAQ,KAAK;AAAA;AAAA,wBAEGC,IAAU,EAEnB,QAAQ,QAAQ,GAGpBJ,EAAeG,EAAUC,EAAS,OAAO,CACpD,EAKMC,EAAsB,IAAM,CAC9B,IAAMF,EAAWN,EAAKI,EAAa,iBAAiB,EAC9CG,EAAU,GAEhB,OAAIT,EAAWQ,CAAQ,GACnB,QAAQ,KAAK,+CAAqC,EAE3C,QAAQ,QAAQ,GAGpBH,EAAeG,EAAUC,EAAS,OAAO,CACpD,GAGC,SAAY,CACT,GAAI,CACA,MAAMF,EAAgB,EACtB,MAAMG,EAAoB,EAE1B,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASC,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["#!/usr/bin/env node\n\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line no-undef\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\n// get the path to the host project.\n// eslint-disable-next-line no-undef\nconst projectPath = resolve(process.cwd(), \"..\", \"..\", \"..\");\n\nconsole.log(\"Configuring @anolilab/textlint-config\", projectPath, \"\\n\");\n\n/**\n * Writes .textlintrc if it doesn't exist. Warns if it exists.\n */\nconst writeTextLintRc = () => {\n const filePath = join(projectPath, \".textlintrc\");\n const content = `{\n \"@textlint/markdown\": {\n \"extensions\": [\".md\", \".mdx\"]\n },\n \"filters\": {\n \"comments\": true\n },\n \"rules\": {\n \"en-capitalization\": true,\n \"footnote-order\": true,\n \"no-todo\": true,\n \"no-dead-link\": {\n \"ignore\": [\"bc_data_*\"]\n },\n \"no-empty-section\": true,\n \"terminology\": true,\n \"apostrophe\": true,\n \"diacritics\": true,\n \"@textlint-rule/no-invalid-control-character\": true,\n \"@textlint-rule/no-unmatched-pair\": true,\n \"abbr-within-parentheses\": true,\n \"alex\": {\n \"allow\": [\"period\", \"european\", \"failure\", \"fore\", \"attack\", \"execution\", \"executed\", \"remain\", \"execute\"]\n },\n \"@textlint-rule/preset-google\": true,\n \"write-good\": {\n \"passive\": false,\n \"eprime\": false\n },\n \"common-misspellings\": true,\n \"terminology\": {\n \"defaultTerms\": false,\n \"terms\": [\n // Abbreviations\n \"API\",\n [\"API['’]?s\", \"APIs\"],\n \"Ajax\",\n \"CLI\",\n \"CSS\",\n \"CORS\",\n [\"^E2E\", \"E2E\"],\n \"gif\",\n [\"^HTML\", \"HTML\"],\n [\"^URL(s?)\", \"URL$1\"],\n [\"^HTTP\", \"HTTP\"],\n [\"^HTTPS\", \"HTTPS\"],\n \"SSO\",\n [\"^XHR(s?)\", \"XHR$1\"],\n [\"^XHR['’]?s\", \"XHRs\"],\n \"Xvfb\",\n \"YAML\",\n\n // Words and phrases\n [\"\\\\(s\\\\)he\", \"they\"],\n [\"he or she\", \"they\"],\n [\"he/she\", \"they\"],\n [\"crazy\", \"complex\"],\n [\"crazier\", \"more complex\"],\n [\"craziest\", \"most complex\"],\n [\"dumb\", \"unintended\"],\n [\"insane\", \"outrageous\"],\n\n // Prefer American spelling\n [\"behaviour\", \"behavior\"],\n [\"cancelled\", \"canceled\"],\n [\"cancelling\", \"canceling\"],\n [\"centre\", \"center\"],\n [\"colour\", \"color\"],\n [\"customise\", \"customize\"],\n [\"customisation\", \"customization\"],\n [\"favourite\", \"favorite\"],\n [\"labelled\", \"labeled\"],\n [\"licence\", \"license\"],\n [\"organise\", \"organize\"],\n\n // Common misspellings\n [\"gaurantee\", \"guarantee\"],\n\n // Words we would like to not use altogether\n [\"simply\", \"\"],\n\n // Single word\n [\"change[- ]log(s?)\", \"changelog$1\"],\n [\"code[- ]base(es?)\", \"codebase$1\"],\n [\"e[- ]mail(s?)\", \"email$1\"],\n [\"end[- ]point(s?)\", \"endpoint$1\"],\n [\"file[- ]name(s?)\", \"filename$1\"],\n [\"can[- ]not\", \"cannot$1\"],\n\n // Multiple words\n [\"back-?end(s?)\", \"back end$1\"],\n [\"front-?end(s?)\", \"front end$1\"],\n [\"full-?stack(s?)\", \"full stack$1\"],\n [\"open-?source(ed?)\", \"open source$1\"],\n [\"web-?page(s?)\", \"web page$1\"],\n\n // Hyphenated\n [\"end ?to ?end\", \"end-to-end\"],\n [\"retryability\", \"retry-ability\"],\n [\"retriability\", \"retry-ability\"],\n\n [\"some\", \"\"],\n [\"filetype\", \"file type\"],\n [\"stylesheet\", \"style sheet\"],\n [\"like this\", \"\"],\n [\"probably\", \"\"],\n [\"known as\", \"\"],\n [\"really\", \"\"],\n [\"just\", \"\"],\n [\"simple\", \"\"],\n [\"obvious\", \"\"],\n [\"straightforward\", \"\"],\n [\"very\", \"\"],\n [\"a little\", \"\"],\n [\"note that\", \"\"],\n [\"good to note\", \"\"],\n [\"good to remember\", \"\"],\n [\"basically\", \"\"],\n [\"actually\", \"\"],\n [\"pretty\", \"\"],\n [\"easy\", \"\"],\n [\"interesting\", \"\"],\n [\"way to\", \"\"],\n [\"In order to\", \"To\"],\n [\"in order to\", \"to\"],\n [\"might\", \"\"],\n [\"us\", \"\"],\n [\"I'll\", \"\"],\n [\"I've\", \"\"],\n [\"they'll\", \"\"],\n [\"it is\", \"it's\"],\n [\"It is\", \"It's\"]\n ]\n }\n }\n}\n`;\n\n if (existsSync(filePath)) {\n console.warn(`⚠️ .textlintrc already exists;\nMake sure that it includes the following for @anolilab/textlint-config'\nto work as it should: ${content}.`);\n\n return Promise.resolve();\n }\n\n return writeFileAsync(filePath, content, \"utf-8\");\n};\n\n/**\n * Writes .textlintignore if it doesn't exist. Warns if it exists.\n */\nconst writeTextLintIgnore = () => {\n const filePath = join(projectPath, \".textlintignore\");\n const content = \"\";\n\n if (existsSync(filePath)) {\n console.warn(\"⚠️ .textlintignore already exists;\");\n\n return Promise.resolve();\n }\n\n return writeFileAsync(filePath, content, \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n await writeTextLintRc();\n await writeTextLintIgnore();\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line no-undef\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n})();\n"]}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { writeFile, existsSync } from 'fs';
|
|
3
|
+
import { resolve, join } from 'path';
|
|
4
|
+
import { promisify } from 'util';
|
|
5
|
+
|
|
6
|
+
process.env.CI&&process.exit(0);var i=promisify(writeFile),o=resolve(process.cwd(),"..","..","..");console.log("Configuring @anolilab/textlint-config",o,`
|
|
7
|
+
`);var c=()=>{let e=join(o,".textlintrc"),t=`{
|
|
8
|
+
"@textlint/markdown": {
|
|
9
|
+
"extensions": [".md", ".mdx"]
|
|
10
|
+
},
|
|
11
|
+
"filters": {
|
|
12
|
+
"comments": true
|
|
13
|
+
},
|
|
14
|
+
"rules": {
|
|
15
|
+
"en-capitalization": true,
|
|
16
|
+
"footnote-order": true,
|
|
17
|
+
"no-todo": true,
|
|
18
|
+
"no-dead-link": {
|
|
19
|
+
"ignore": ["bc_data_*"]
|
|
20
|
+
},
|
|
21
|
+
"no-empty-section": true,
|
|
22
|
+
"terminology": true,
|
|
23
|
+
"apostrophe": true,
|
|
24
|
+
"diacritics": true,
|
|
25
|
+
"@textlint-rule/no-invalid-control-character": true,
|
|
26
|
+
"@textlint-rule/no-unmatched-pair": true,
|
|
27
|
+
"abbr-within-parentheses": true,
|
|
28
|
+
"alex": {
|
|
29
|
+
"allow": ["period", "european", "failure", "fore", "attack", "execution", "executed", "remain", "execute"]
|
|
30
|
+
},
|
|
31
|
+
"@textlint-rule/preset-google": true,
|
|
32
|
+
"write-good": {
|
|
33
|
+
"passive": false,
|
|
34
|
+
"eprime": false
|
|
35
|
+
},
|
|
36
|
+
"common-misspellings": true,
|
|
37
|
+
"terminology": {
|
|
38
|
+
"defaultTerms": false,
|
|
39
|
+
"terms": [
|
|
40
|
+
// Abbreviations
|
|
41
|
+
"API",
|
|
42
|
+
["API['\u2019]?s", "APIs"],
|
|
43
|
+
"Ajax",
|
|
44
|
+
"CLI",
|
|
45
|
+
"CSS",
|
|
46
|
+
"CORS",
|
|
47
|
+
["^E2E", "E2E"],
|
|
48
|
+
"gif",
|
|
49
|
+
["^HTML", "HTML"],
|
|
50
|
+
["^URL(s?)", "URL$1"],
|
|
51
|
+
["^HTTP", "HTTP"],
|
|
52
|
+
["^HTTPS", "HTTPS"],
|
|
53
|
+
"SSO",
|
|
54
|
+
["^XHR(s?)", "XHR$1"],
|
|
55
|
+
["^XHR['\u2019]?s", "XHRs"],
|
|
56
|
+
"Xvfb",
|
|
57
|
+
"YAML",
|
|
58
|
+
|
|
59
|
+
// Words and phrases
|
|
60
|
+
["\\(s\\)he", "they"],
|
|
61
|
+
["he or she", "they"],
|
|
62
|
+
["he/she", "they"],
|
|
63
|
+
["crazy", "complex"],
|
|
64
|
+
["crazier", "more complex"],
|
|
65
|
+
["craziest", "most complex"],
|
|
66
|
+
["dumb", "unintended"],
|
|
67
|
+
["insane", "outrageous"],
|
|
68
|
+
|
|
69
|
+
// Prefer American spelling
|
|
70
|
+
["behaviour", "behavior"],
|
|
71
|
+
["cancelled", "canceled"],
|
|
72
|
+
["cancelling", "canceling"],
|
|
73
|
+
["centre", "center"],
|
|
74
|
+
["colour", "color"],
|
|
75
|
+
["customise", "customize"],
|
|
76
|
+
["customisation", "customization"],
|
|
77
|
+
["favourite", "favorite"],
|
|
78
|
+
["labelled", "labeled"],
|
|
79
|
+
["licence", "license"],
|
|
80
|
+
["organise", "organize"],
|
|
81
|
+
|
|
82
|
+
// Common misspellings
|
|
83
|
+
["gaurantee", "guarantee"],
|
|
84
|
+
|
|
85
|
+
// Words we would like to not use altogether
|
|
86
|
+
["simply", ""],
|
|
87
|
+
|
|
88
|
+
// Single word
|
|
89
|
+
["change[- ]log(s?)", "changelog$1"],
|
|
90
|
+
["code[- ]base(es?)", "codebase$1"],
|
|
91
|
+
["e[- ]mail(s?)", "email$1"],
|
|
92
|
+
["end[- ]point(s?)", "endpoint$1"],
|
|
93
|
+
["file[- ]name(s?)", "filename$1"],
|
|
94
|
+
["can[- ]not", "cannot$1"],
|
|
95
|
+
|
|
96
|
+
// Multiple words
|
|
97
|
+
["back-?end(s?)", "back end$1"],
|
|
98
|
+
["front-?end(s?)", "front end$1"],
|
|
99
|
+
["full-?stack(s?)", "full stack$1"],
|
|
100
|
+
["open-?source(ed?)", "open source$1"],
|
|
101
|
+
["web-?page(s?)", "web page$1"],
|
|
102
|
+
|
|
103
|
+
// Hyphenated
|
|
104
|
+
["end ?to ?end", "end-to-end"],
|
|
105
|
+
["retryability", "retry-ability"],
|
|
106
|
+
["retriability", "retry-ability"],
|
|
107
|
+
|
|
108
|
+
["some", ""],
|
|
109
|
+
["filetype", "file type"],
|
|
110
|
+
["stylesheet", "style sheet"],
|
|
111
|
+
["like this", ""],
|
|
112
|
+
["probably", ""],
|
|
113
|
+
["known as", ""],
|
|
114
|
+
["really", ""],
|
|
115
|
+
["just", ""],
|
|
116
|
+
["simple", ""],
|
|
117
|
+
["obvious", ""],
|
|
118
|
+
["straightforward", ""],
|
|
119
|
+
["very", ""],
|
|
120
|
+
["a little", ""],
|
|
121
|
+
["note that", ""],
|
|
122
|
+
["good to note", ""],
|
|
123
|
+
["good to remember", ""],
|
|
124
|
+
["basically", ""],
|
|
125
|
+
["actually", ""],
|
|
126
|
+
["pretty", ""],
|
|
127
|
+
["easy", ""],
|
|
128
|
+
["interesting", ""],
|
|
129
|
+
["way to", ""],
|
|
130
|
+
["In order to", "To"],
|
|
131
|
+
["in order to", "to"],
|
|
132
|
+
["might", ""],
|
|
133
|
+
["us", ""],
|
|
134
|
+
["I'll", ""],
|
|
135
|
+
["I've", ""],
|
|
136
|
+
["they'll", ""],
|
|
137
|
+
["it is", "it's"],
|
|
138
|
+
["It is", "It's"]
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
`;return existsSync(e)?(console.warn(`\u26A0\uFE0F .textlintrc already exists;
|
|
144
|
+
Make sure that it includes the following for @anolilab/textlint-config'
|
|
145
|
+
to work as it should: ${t}.`),Promise.resolve()):i(e,t,"utf-8")},u=()=>{let e=join(o,".textlintignore"),t="";return existsSync(e)?(console.warn("\u26A0\uFE0F .textlintignore already exists;"),Promise.resolve()):i(e,t,"utf-8")};(async()=>{try{await c(),await u(),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(e){console.log("\u{1F62C} something went wrong:"),console.error(e),process.exit(1);}})();
|
|
146
|
+
//# sourceMappingURL=out.js.map
|
|
147
|
+
//# sourceMappingURL=postinstall.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/postinstall.ts"],"names":["existsSync","writeFile","join","resolve","promisify","writeFileAsync","projectPath","writeTextLintRc","filePath","content","writeTextLintIgnore","error"],"mappings":";AAEA,OAAS,cAAAA,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,EAAM,WAAAC,MAAe,OAC9B,OAAS,aAAAC,MAAiB,OAEtB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUH,CAAS,EAIpCK,EAAcH,EAAQ,QAAQ,IAAI,EAAG,KAAM,KAAM,IAAI,EAE3D,QAAQ,IAAI,wCAAyCG,EAAa;AAAA,CAAI,EAKtE,IAAMC,EAAkB,IAAM,CAC1B,IAAMC,EAAWN,EAAKI,EAAa,aAAa,EAC1CG,EAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0IhB,OAAIT,EAAWQ,CAAQ,GACnB,QAAQ,KAAK;AAAA;AAAA,wBAEGC,IAAU,EAEnB,QAAQ,QAAQ,GAGpBJ,EAAeG,EAAUC,EAAS,OAAO,CACpD,EAKMC,EAAsB,IAAM,CAC9B,IAAMF,EAAWN,EAAKI,EAAa,iBAAiB,EAC9CG,EAAU,GAEhB,OAAIT,EAAWQ,CAAQ,GACnB,QAAQ,KAAK,+CAAqC,EAE3C,QAAQ,QAAQ,GAGpBH,EAAeG,EAAUC,EAAS,OAAO,CACpD,GAGC,SAAY,CACT,GAAI,CACA,MAAMF,EAAgB,EACtB,MAAMG,EAAoB,EAE1B,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASC,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["#!/usr/bin/env node\n\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line no-undef\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\n// get the path to the host project.\n// eslint-disable-next-line no-undef\nconst projectPath = resolve(process.cwd(), \"..\", \"..\", \"..\");\n\nconsole.log(\"Configuring @anolilab/textlint-config\", projectPath, \"\\n\");\n\n/**\n * Writes .textlintrc if it doesn't exist. Warns if it exists.\n */\nconst writeTextLintRc = () => {\n const filePath = join(projectPath, \".textlintrc\");\n const content = `{\n \"@textlint/markdown\": {\n \"extensions\": [\".md\", \".mdx\"]\n },\n \"filters\": {\n \"comments\": true\n },\n \"rules\": {\n \"en-capitalization\": true,\n \"footnote-order\": true,\n \"no-todo\": true,\n \"no-dead-link\": {\n \"ignore\": [\"bc_data_*\"]\n },\n \"no-empty-section\": true,\n \"terminology\": true,\n \"apostrophe\": true,\n \"diacritics\": true,\n \"@textlint-rule/no-invalid-control-character\": true,\n \"@textlint-rule/no-unmatched-pair\": true,\n \"abbr-within-parentheses\": true,\n \"alex\": {\n \"allow\": [\"period\", \"european\", \"failure\", \"fore\", \"attack\", \"execution\", \"executed\", \"remain\", \"execute\"]\n },\n \"@textlint-rule/preset-google\": true,\n \"write-good\": {\n \"passive\": false,\n \"eprime\": false\n },\n \"common-misspellings\": true,\n \"terminology\": {\n \"defaultTerms\": false,\n \"terms\": [\n // Abbreviations\n \"API\",\n [\"API['’]?s\", \"APIs\"],\n \"Ajax\",\n \"CLI\",\n \"CSS\",\n \"CORS\",\n [\"^E2E\", \"E2E\"],\n \"gif\",\n [\"^HTML\", \"HTML\"],\n [\"^URL(s?)\", \"URL$1\"],\n [\"^HTTP\", \"HTTP\"],\n [\"^HTTPS\", \"HTTPS\"],\n \"SSO\",\n [\"^XHR(s?)\", \"XHR$1\"],\n [\"^XHR['’]?s\", \"XHRs\"],\n \"Xvfb\",\n \"YAML\",\n\n // Words and phrases\n [\"\\\\(s\\\\)he\", \"they\"],\n [\"he or she\", \"they\"],\n [\"he/she\", \"they\"],\n [\"crazy\", \"complex\"],\n [\"crazier\", \"more complex\"],\n [\"craziest\", \"most complex\"],\n [\"dumb\", \"unintended\"],\n [\"insane\", \"outrageous\"],\n\n // Prefer American spelling\n [\"behaviour\", \"behavior\"],\n [\"cancelled\", \"canceled\"],\n [\"cancelling\", \"canceling\"],\n [\"centre\", \"center\"],\n [\"colour\", \"color\"],\n [\"customise\", \"customize\"],\n [\"customisation\", \"customization\"],\n [\"favourite\", \"favorite\"],\n [\"labelled\", \"labeled\"],\n [\"licence\", \"license\"],\n [\"organise\", \"organize\"],\n\n // Common misspellings\n [\"gaurantee\", \"guarantee\"],\n\n // Words we would like to not use altogether\n [\"simply\", \"\"],\n\n // Single word\n [\"change[- ]log(s?)\", \"changelog$1\"],\n [\"code[- ]base(es?)\", \"codebase$1\"],\n [\"e[- ]mail(s?)\", \"email$1\"],\n [\"end[- ]point(s?)\", \"endpoint$1\"],\n [\"file[- ]name(s?)\", \"filename$1\"],\n [\"can[- ]not\", \"cannot$1\"],\n\n // Multiple words\n [\"back-?end(s?)\", \"back end$1\"],\n [\"front-?end(s?)\", \"front end$1\"],\n [\"full-?stack(s?)\", \"full stack$1\"],\n [\"open-?source(ed?)\", \"open source$1\"],\n [\"web-?page(s?)\", \"web page$1\"],\n\n // Hyphenated\n [\"end ?to ?end\", \"end-to-end\"],\n [\"retryability\", \"retry-ability\"],\n [\"retriability\", \"retry-ability\"],\n\n [\"some\", \"\"],\n [\"filetype\", \"file type\"],\n [\"stylesheet\", \"style sheet\"],\n [\"like this\", \"\"],\n [\"probably\", \"\"],\n [\"known as\", \"\"],\n [\"really\", \"\"],\n [\"just\", \"\"],\n [\"simple\", \"\"],\n [\"obvious\", \"\"],\n [\"straightforward\", \"\"],\n [\"very\", \"\"],\n [\"a little\", \"\"],\n [\"note that\", \"\"],\n [\"good to note\", \"\"],\n [\"good to remember\", \"\"],\n [\"basically\", \"\"],\n [\"actually\", \"\"],\n [\"pretty\", \"\"],\n [\"easy\", \"\"],\n [\"interesting\", \"\"],\n [\"way to\", \"\"],\n [\"In order to\", \"To\"],\n [\"in order to\", \"to\"],\n [\"might\", \"\"],\n [\"us\", \"\"],\n [\"I'll\", \"\"],\n [\"I've\", \"\"],\n [\"they'll\", \"\"],\n [\"it is\", \"it's\"],\n [\"It is\", \"It's\"]\n ]\n }\n }\n}\n`;\n\n if (existsSync(filePath)) {\n console.warn(`⚠️ .textlintrc already exists;\nMake sure that it includes the following for @anolilab/textlint-config'\nto work as it should: ${content}.`);\n\n return Promise.resolve();\n }\n\n return writeFileAsync(filePath, content, \"utf-8\");\n};\n\n/**\n * Writes .textlintignore if it doesn't exist. Warns if it exists.\n */\nconst writeTextLintIgnore = () => {\n const filePath = join(projectPath, \".textlintignore\");\n const content = \"\";\n\n if (existsSync(filePath)) {\n console.warn(\"⚠️ .textlintignore already exists;\");\n\n return Promise.resolve();\n }\n\n return writeFileAsync(filePath, content, \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n await writeTextLintRc();\n await writeTextLintIgnore();\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line no-undef\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n})();\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anolilab/textlint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Anolilab Coding Standard for text linting.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -30,42 +30,45 @@
|
|
|
30
30
|
"name": "Daniel Bannert",
|
|
31
31
|
"email": "d.bannert@anolilab.de"
|
|
32
32
|
},
|
|
33
|
-
"
|
|
33
|
+
"source": "src/postinstall.ts",
|
|
34
34
|
"files": [
|
|
35
|
-
"
|
|
35
|
+
"dist",
|
|
36
36
|
"README.md",
|
|
37
37
|
"CHANGELOG.md",
|
|
38
38
|
"LICENSE.md"
|
|
39
39
|
],
|
|
40
40
|
"scripts": {
|
|
41
|
-
"
|
|
41
|
+
"build": "cross-env NODE_ENV=development tsup",
|
|
42
|
+
"build:prod": "cross-env NODE_ENV=production tsup",
|
|
43
|
+
"clean": "rimraf node_modules dist",
|
|
44
|
+
"postinstall": "node ./skip.js || node ./dist/postinstall.js"
|
|
42
45
|
},
|
|
43
46
|
"dependencies": {
|
|
44
|
-
"@textlint-rule/textlint-rule-no-invalid-control-character": "2.0.0",
|
|
45
|
-
"@textlint-rule/textlint-rule-no-unmatched-pair": "1.0.9",
|
|
46
|
-
"@textlint-rule/textlint-rule-preset-google": "0.1.2",
|
|
47
|
+
"@textlint-rule/textlint-rule-no-invalid-control-character": "^2.0.0",
|
|
48
|
+
"@textlint-rule/textlint-rule-no-unmatched-pair": "^1.0.9",
|
|
49
|
+
"@textlint-rule/textlint-rule-preset-google": "^0.1.2",
|
|
47
50
|
"@textlint/ast-node-types": "^13.3.2",
|
|
48
51
|
"@textlint/types": "^13.3.2",
|
|
49
52
|
"textlint-filter-rule-comments": "^1.2.2",
|
|
50
|
-
"textlint-rule-abbr-within-parentheses": "1.0.2",
|
|
51
|
-
"textlint-rule-alex": "3.0.0",
|
|
52
|
-
"textlint-rule-apostrophe": "2.0.0",
|
|
53
|
-
"textlint-rule-common-misspellings": "1.0.1",
|
|
53
|
+
"textlint-rule-abbr-within-parentheses": "^1.0.2",
|
|
54
|
+
"textlint-rule-alex": "^3.0.0",
|
|
55
|
+
"textlint-rule-apostrophe": "^2.0.0",
|
|
56
|
+
"textlint-rule-common-misspellings": "^1.0.1",
|
|
54
57
|
"textlint-rule-date-weekday-mismatch": "^1.0.6",
|
|
55
|
-
"textlint-rule-diacritics": "1.0.0",
|
|
56
|
-
"textlint-rule-en-capitalization": "2.0.3",
|
|
57
|
-
"textlint-rule-footnote-order": "1.0.3",
|
|
58
|
-
"textlint-rule-helper": "2.3.0",
|
|
59
|
-
"textlint-rule-no-dead-link": "5.1.2",
|
|
60
|
-
"textlint-rule-no-empty-section": "1.1.0",
|
|
61
|
-
"textlint-rule-no-todo": "2.0.1",
|
|
62
|
-
"textlint-rule-terminology": "3.0.4",
|
|
63
|
-
"textlint-rule-write-good": "2.0.0",
|
|
64
|
-
"write-good": "1.0.8"
|
|
58
|
+
"textlint-rule-diacritics": "^1.0.0",
|
|
59
|
+
"textlint-rule-en-capitalization": "^2.0.3",
|
|
60
|
+
"textlint-rule-footnote-order": "^1.0.3",
|
|
61
|
+
"textlint-rule-helper": "^2.3.0",
|
|
62
|
+
"textlint-rule-no-dead-link": "^5.1.2",
|
|
63
|
+
"textlint-rule-no-empty-section": "^1.1.0",
|
|
64
|
+
"textlint-rule-no-todo": "^2.0.1",
|
|
65
|
+
"textlint-rule-terminology": "^3.0.4",
|
|
66
|
+
"textlint-rule-write-good": "^2.0.0",
|
|
67
|
+
"write-good": "^1.0.8"
|
|
65
68
|
},
|
|
66
69
|
"devDependencies": {
|
|
67
|
-
"
|
|
68
|
-
"
|
|
70
|
+
"@anolilab/semantic-release-preset": "3.0.0",
|
|
71
|
+
"textlint": "^13.3.2"
|
|
69
72
|
},
|
|
70
73
|
"peerDependencies": {
|
|
71
74
|
"textlint": "^13.3.2"
|
|
@@ -74,23 +77,7 @@
|
|
|
74
77
|
"node": ">=16"
|
|
75
78
|
},
|
|
76
79
|
"publishConfig": {
|
|
77
|
-
"access": "public"
|
|
78
|
-
|
|
79
|
-
"pnpm": {
|
|
80
|
-
"overrides": {
|
|
81
|
-
"glob-parent@<5.1.2": ">=5.1.2",
|
|
82
|
-
"minimist@<1.2.6": ">=1.2.6",
|
|
83
|
-
"chrono-node@<2.2.4": ">=2.2.4",
|
|
84
|
-
"yargs-parser@>=6.0.0 <13.1.2": ">=13.1.2",
|
|
85
|
-
"trim@<0.0.3": ">=0.0.3",
|
|
86
|
-
"trim-newlines@<3.0.1": ">=3.0.1",
|
|
87
|
-
"moment@<2.29.2": ">=2.29.2",
|
|
88
|
-
"semver-regex@<3.1.4": ">=3.1.4",
|
|
89
|
-
"npm@>=7.9.0 <8.11.0": ">=8.11.0",
|
|
90
|
-
"got@<11.8.5": ">=11.8.5",
|
|
91
|
-
"moment@>=2.18.0 <2.29.4": ">=2.29.4",
|
|
92
|
-
"ansi-regex@>=3.0.0 <3.0.1": ">=3.0.1",
|
|
93
|
-
"ansi-regex@>=4.0.0 <4.1.1": ">=4.1.1"
|
|
94
|
-
}
|
|
80
|
+
"access": "public",
|
|
81
|
+
"provenance": true
|
|
95
82
|
}
|
|
96
83
|
}
|
package/lib/postinstall.js
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { existsSync, writeFile } from "node:fs";
|
|
4
|
-
import { join, resolve } from "node:path";
|
|
5
|
-
import { promisify } from "node:util";
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line no-undef
|
|
8
|
-
if (process.env.CI) {
|
|
9
|
-
// eslint-disable-next-line no-undef
|
|
10
|
-
process.exit(0);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const writeFileAsync = promisify(writeFile);
|
|
14
|
-
|
|
15
|
-
// get the path to the host project.
|
|
16
|
-
// eslint-disable-next-line no-undef
|
|
17
|
-
const projectPath = resolve(process.cwd(), "..", "..", "..");
|
|
18
|
-
|
|
19
|
-
console.log("Configuring @anolilab/textlint-config", projectPath, "\n");
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Writes .textlintrc if it doesn't exist. Warns if it exists.
|
|
23
|
-
*/
|
|
24
|
-
const writeTextlintRc = () => {
|
|
25
|
-
const eslintPath = join(projectPath, ".textlintrc");
|
|
26
|
-
const content = `{
|
|
27
|
-
"filters": {
|
|
28
|
-
"comments": true
|
|
29
|
-
},
|
|
30
|
-
"rules": {
|
|
31
|
-
"@textlint-rule/no-invalid-control-character": true,
|
|
32
|
-
"@textlint-rule/no-unmatched-pair": true,
|
|
33
|
-
"@textlint-rule/preset-google": true,
|
|
34
|
-
"abbr-within-parentheses": true,
|
|
35
|
-
"apostrophe": true,
|
|
36
|
-
"alex": {
|
|
37
|
-
"allow": [
|
|
38
|
-
"attack",
|
|
39
|
-
"european",
|
|
40
|
-
"execute"
|
|
41
|
-
"executed",
|
|
42
|
-
"execution",
|
|
43
|
-
"failure",
|
|
44
|
-
"fore",
|
|
45
|
-
"period",
|
|
46
|
-
"remain",
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
"common-misspellings": true,
|
|
50
|
-
"date-weekday-mismatch": true
|
|
51
|
-
"diacritics": true,
|
|
52
|
-
"en-capitalization": true,
|
|
53
|
-
"footnote-order": true,
|
|
54
|
-
"no-dead-link": {
|
|
55
|
-
"ignore": [
|
|
56
|
-
"bc_data_*",
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
"no-empty-section": true,
|
|
60
|
-
"no-todo": true,
|
|
61
|
-
"terminology": true,
|
|
62
|
-
"terminology": {
|
|
63
|
-
"defaultTerms": false,
|
|
64
|
-
"terms": [
|
|
65
|
-
// Abbreviations
|
|
66
|
-
"API",
|
|
67
|
-
["API['’]?s", "APIs"],
|
|
68
|
-
"Ajax",
|
|
69
|
-
"CLI",
|
|
70
|
-
"CSS",
|
|
71
|
-
"CORS",
|
|
72
|
-
["^E2E", "E2E"],
|
|
73
|
-
"gif",
|
|
74
|
-
["^HTML", "HTML"],
|
|
75
|
-
["^URL(s?)", "URL$1"],
|
|
76
|
-
["^HTTP", "HTTP"],
|
|
77
|
-
["^HTTPS", "HTTPS"],
|
|
78
|
-
"SSO",
|
|
79
|
-
["^XHR(s?)", "XHR$1"],
|
|
80
|
-
["^XHR['’]?s", "XHRs"],
|
|
81
|
-
"Xvfb",
|
|
82
|
-
"YAML",
|
|
83
|
-
|
|
84
|
-
// Words and phrases
|
|
85
|
-
["\\\\(s\\\\)he", "they"],
|
|
86
|
-
["he or she", "they"],
|
|
87
|
-
["he/she", "they"],
|
|
88
|
-
["crazy", "complex"],
|
|
89
|
-
["crazier", "more complex"],
|
|
90
|
-
["craziest", "most complex"],
|
|
91
|
-
["dumb", "unintended"],
|
|
92
|
-
["insane", "outrageous"],
|
|
93
|
-
|
|
94
|
-
// Prefer American spelling
|
|
95
|
-
["behaviour", "behavior"],
|
|
96
|
-
["cancelled", "canceled"],
|
|
97
|
-
["cancelling", "canceling"],
|
|
98
|
-
["centre", "center"],
|
|
99
|
-
["colour", "color"],
|
|
100
|
-
["customise", "customize"],
|
|
101
|
-
["customisation", "customization"],
|
|
102
|
-
["favourite", "favorite"],
|
|
103
|
-
["labelled", "labeled"],
|
|
104
|
-
["licence", "license"],
|
|
105
|
-
["organise", "organize"],
|
|
106
|
-
|
|
107
|
-
// Common misspellings
|
|
108
|
-
["gaurantee", "guarantee"],
|
|
109
|
-
|
|
110
|
-
// Words we would like to not use altogether
|
|
111
|
-
["simply", ""],
|
|
112
|
-
|
|
113
|
-
// Single word
|
|
114
|
-
["change[- ]log(s?)", "changelog$1"],
|
|
115
|
-
["code[- ]base(es?)", "codebase$1"],
|
|
116
|
-
["e[- ]mail(s?)", "email$1"],
|
|
117
|
-
["end[- ]point(s?)", "endpoint$1"],
|
|
118
|
-
["file[- ]name(s?)", "filename$1"],
|
|
119
|
-
["can[- ]not", "cannot$1"],
|
|
120
|
-
|
|
121
|
-
// Multiple words
|
|
122
|
-
["back-?end(s?)", "back end$1"],
|
|
123
|
-
["front-?end(s?)", "front end$1"],
|
|
124
|
-
["full-?stack(s?)", "full stack$1"],
|
|
125
|
-
["open-?source(ed?)", "open source$1"],
|
|
126
|
-
["web-?page(s?)", "web page$1"],
|
|
127
|
-
|
|
128
|
-
// Hyphenated
|
|
129
|
-
["end ?to ?end", "end-to-end"],
|
|
130
|
-
["retryability", "retry-ability"],
|
|
131
|
-
["retriability", "retry-ability"],
|
|
132
|
-
|
|
133
|
-
["some", ""],
|
|
134
|
-
["filetype", "file type"],
|
|
135
|
-
["stylesheet", "style sheet"],
|
|
136
|
-
["like this", ""],
|
|
137
|
-
["probably", ""],
|
|
138
|
-
["known as", ""],
|
|
139
|
-
["really", ""],
|
|
140
|
-
["just", ""],
|
|
141
|
-
["simple", ""],
|
|
142
|
-
["obvious", ""],
|
|
143
|
-
["straightforward", ""],
|
|
144
|
-
["very", ""],
|
|
145
|
-
["a little", ""],
|
|
146
|
-
["note that", ""],
|
|
147
|
-
["good to note", ""],
|
|
148
|
-
["good to remember", ""],
|
|
149
|
-
["basically", ""],
|
|
150
|
-
["actually", ""],
|
|
151
|
-
["pretty", ""],
|
|
152
|
-
["easy", ""],
|
|
153
|
-
["interesting", ""],
|
|
154
|
-
["way to", ""],
|
|
155
|
-
["In order to", "To"],
|
|
156
|
-
["in order to", "to"],
|
|
157
|
-
["might", ""],
|
|
158
|
-
["us", ""],
|
|
159
|
-
["I'll", ""],
|
|
160
|
-
["I've", ""],
|
|
161
|
-
["they'll", ""],
|
|
162
|
-
["it is", "it's"],
|
|
163
|
-
["It is", "It's"],
|
|
164
|
-
]
|
|
165
|
-
},
|
|
166
|
-
"write-good": {
|
|
167
|
-
"passive": false,
|
|
168
|
-
"eprime": false,
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
`;
|
|
173
|
-
|
|
174
|
-
if (existsSync(eslintPath)) {
|
|
175
|
-
console.warn(`⚠️ .textlintrc already exists;
|
|
176
|
-
Make sure that it includes the following for @anolilab/textlint-config'
|
|
177
|
-
to work as it should: ${content}.`);
|
|
178
|
-
|
|
179
|
-
return Promise.resolve();
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return writeFileAsync(eslintPath, content, "utf-8");
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Writes .textlintignore if it doesn't exist. Warns if it exists.
|
|
187
|
-
*/
|
|
188
|
-
const writeTextlintIgnore = () => {
|
|
189
|
-
const eslintPath = join(projectPath, ".textlintignore");
|
|
190
|
-
const content = "";
|
|
191
|
-
|
|
192
|
-
if (existsSync(eslintPath)) {
|
|
193
|
-
console.warn("⚠️ .textlintignore already exists;");
|
|
194
|
-
|
|
195
|
-
return Promise.resolve();
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
return writeFileAsync(eslintPath, content, "utf-8");
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
// eslint-disable-next-line unicorn/prefer-top-level-await
|
|
202
|
-
(async () => {
|
|
203
|
-
try {
|
|
204
|
-
await writeTextlintRc();
|
|
205
|
-
await writeTextlintIgnore();
|
|
206
|
-
|
|
207
|
-
console.log("😎 Everything went well, have fun!");
|
|
208
|
-
|
|
209
|
-
// eslint-disable-next-line no-undef
|
|
210
|
-
process.exit(0);
|
|
211
|
-
} catch (error) {
|
|
212
|
-
console.log("😬 something went wrong:");
|
|
213
|
-
console.error(error.message);
|
|
214
|
-
|
|
215
|
-
// eslint-disable-next-line no-undef
|
|
216
|
-
process.exit(1);
|
|
217
|
-
}
|
|
218
|
-
})();
|