Skip to content

Commit 1cbba75

Browse files
Docs: Update requireDictionaryWords and README
1 parent e936e8c commit 1cbba75

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This JSCS plugin checks for words that can't be found in a dictionary, and tells
2020
you where they are so that you can spell them correctly. You can choose which
2121
dictionaries and languages to use. You can add more words and ignore existing
2222
ones. You can define exceptions for names used by 3rd parties. You can even
23-
restrict a word's usage to property names only.
23+
restrict a word's usage to identifiers or property names only.
2424

2525
## Installation
2626

@@ -65,11 +65,13 @@ Values:
6565
- `Object`:
6666
- `dictionaries`: (default `["english"]`) array of dictionary names including
6767
`"english"`, `"american"`, `"british"` and `"canadian"`
68-
- `allowWordsInIdentifiersAndProperties`: additional words allowed anywhere
69-
- `allowWordsInProperties`: additional words allowed only as properties
70-
- `allowNamesForIdentifiersAndProperties`: names ignored by spellcheck
71-
- `allowNamesForProperties`: names ignored by spellcheck when used as properties
72-
- `excluded`: words to exclude from the dictionaries
68+
- `allowWords`: additional words allowed anywhere
69+
- `allowWordsInIdentifiers`: additional words allowed only in identifiers
70+
- `allowWordsInProperties`: additional words allowed only in properties
71+
- `allowNames`: whole names ignored by spellcheck
72+
- `allowNamesAsIdentifiers`: whole names ignored by spellcheck when used as identifiers
73+
- `allowNamesAsProperties`: whole names ignored by spellcheck when used as properties
74+
- `excludeWords`: words to exclude from the dictionaries
7375

7476
#### Example
7577

@@ -78,11 +80,11 @@ Values:
7880

7981
"requireDictionaryWords": {
8082
"dictionaries": [ "english", "american" ],
81-
"allowWordsInIdentifiersAndProperties": [ "transclude" ],
83+
"allowWords": [ "transclude" ],
8284
"allowWordsInProperties": [ "chmod" ],
83-
"allowNamesForIdentifiersAndProperties": [ "$stateParams", "util" ],
84-
"allowNamesForProperties": [ "src" ],
85-
"excluded": [ "i" ]
85+
"allowNamesAsIdentifiers": [ "$stateParams", "util" ],
86+
"allowNamesAsProperties": [ "src" ],
87+
"excludeWords": [ "i" ]
8688
}
8789
```
8890

@@ -116,7 +118,7 @@ var color = 'papayawhip';
116118
var colour = 'papayawhip';
117119
```
118120

119-
##### Valid for mode `"allowWordsInIdentifiersAndProperties": [ "transclude" ]`
121+
##### Valid for mode `"allowWords": [ "transclude" ]`
120122

121123
```js
122124
var transclude = function() {};
@@ -138,33 +140,33 @@ fs.chmodSync('/', mode);
138140
var chmod = 0777;
139141
```
140142

141-
##### Valid for mode `"allowNamesForIdentifiersAndProperties": [ "$stateParams", "util" ]`
143+
##### Valid for mode `"allowNamesAsIdentifiers": [ "$stateParams", "util" ]`
142144

143145
```js
144146
var util = require('util');
145147
function Controller($stateParams) {}
146148
```
147149

148-
##### Invalid for mode `"allowNamesForIdentifiersAndProperties": [ "$stateParams", "util" ]`
150+
##### Invalid for mode `"allowNamesAsIdentifiers": [ "$stateParams", "util" ]`
149151

150152
```js
151153
var stringUtil = {};
152154
var params = {};
153155
```
154156

155-
##### Valid for mode `"allowNamesForProperties": [ "src" ]`
157+
##### Valid for mode `"allowNamesAsProperties": [ "src" ]`
156158

157159
```js
158160
element.src = 'https://youtu.be/dQw4w9WgXcQ';
159161
```
160162

161-
##### Invalid for mode `"allowNamesForProperties": [ "src" ]`
163+
##### Invalid for mode `"allowNamesAsProperties": [ "src" ]`
162164

163165
```js
164166
var data = { videoSrc: 'youtube' };
165167
```
166168

167-
##### Invalid for mode `"excluded": [ "i" ]`
169+
##### Invalid for mode `"excludeWords": [ "i" ]`
168170

169171
```js
170172
for (var i = 0; i < array.length; i++) {}

lib/rules/require-dictionary-words.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* - `allowWords`: additional words allowed anywhere
1616
* - `allowWordsInIdentifiers`: additional words allowed only in identifiers
1717
* - `allowWordsInProperties`: additional words allowed only in properties
18-
* - `allowNames`: names ignored by spellcheck
18+
* - `allowNames`: whole names ignored by spellcheck
1919
* - `allowNamesAsIdentifiers`: whole names ignored by spellcheck when used as identifiers
2020
* - `allowNamesAsProperties`: whole names ignored by spellcheck when used as properties
2121
* - `excludeWords`: words to exclude from the dictionaries

0 commit comments

Comments
 (0)