12
12
* - `Object`:
13
13
* - `dictionaries`: (default `["english"]`) array of dictionary names including
14
14
* `"english"`, `"american"`, `"british"` and `"canadian"`
15
- * - `allowWordsInIdentifiersAndProperties `: additional words allowed anywhere
15
+ * - `allowWords `: additional words allowed anywhere
16
16
* - `allowWordsInProperties`: additional words allowed only as properties
17
- * - `allowNamesForIdentifiersAndProperties `: names ignored by spellcheck
18
- * - `allowNamesForProperties `: names ignored by spellcheck when used as properties
19
- * - `excluded `: words to exclude from the dictionaries
17
+ * - `allowNames `: names ignored by spellcheck
18
+ * - `allowNamesAsProperties `: names ignored by spellcheck when used as properties
19
+ * - `excludeWords `: words to exclude from the dictionaries
20
20
*
21
21
* #### Example
22
22
*
25
25
*
26
26
* "requireDictionaryWords": {
27
27
* "dictionaries": [ "english", "american" ],
28
- * "allowWordsInIdentifiersAndProperties ": [ "transclude" ],
28
+ * "allowWords ": [ "transclude" ],
29
29
* "allowWordsInProperties": [ "chmod" ],
30
- * "allowNamesForIdentifiersAndProperties ": [ "$stateParams", "util" ],
31
- * "allowNamesForProperties ": [ "src" ],
32
- * "excluded ": [ "i" ]
30
+ * "allowNames ": [ "$stateParams", "util" ],
31
+ * "allowNamesAsProperties ": [ "src" ],
32
+ * "excludeWords ": [ "i" ]
33
33
* }
34
34
* ```
35
35
*
63
63
* var colour = 'papayawhip';
64
64
* ```
65
65
*
66
- * ##### Valid for mode `"allowWordsInIdentifiersAndProperties ": [ "transclude" ]`
66
+ * ##### Valid for mode `"allowWords ": [ "transclude" ]`
67
67
*
68
68
* ```js
69
69
* var transclude = function() {};
85
85
* var chmod = 0777;
86
86
* ```
87
87
*
88
- * ##### Valid for mode `"allowNamesForIdentifiersAndProperties ": [ "$stateParams", "util" ]`
88
+ * ##### Valid for mode `"allowNames ": [ "$stateParams", "util" ]`
89
89
*
90
90
* ```js
91
91
* var util = require('util');
92
92
* function Controller($stateParams) {}
93
93
* ```
94
94
*
95
- * ##### Invalid for mode `"allowNamesForIdentifiersAndProperties ": [ "$stateParams", "util" ]`
95
+ * ##### Invalid for mode `"allowNames ": [ "$stateParams", "util" ]`
96
96
*
97
97
* ```js
98
98
* var stringUtil = {};
99
99
* var params = {};
100
100
* ```
101
101
*
102
- * ##### Valid for mode `"allowNamesForProperties ": [ "src" ]`
102
+ * ##### Valid for mode `"allowNamesAsProperties ": [ "src" ]`
103
103
*
104
104
* ```js
105
105
* element.src = 'https://youtu.be/dQw4w9WgXcQ';
106
106
* ```
107
107
*
108
- * ##### Invalid for mode `"allowNamesForProperties ": [ "src" ]`
108
+ * ##### Invalid for mode `"allowNamesAsProperties ": [ "src" ]`
109
109
*
110
110
* ```js
111
111
* var data = { videoSrc: 'youtube' };
112
112
* ```
113
113
*
114
- * ##### Invalid for mode `"excluded ": [ "i" ]`
114
+ * ##### Invalid for mode `"excludeWords ": [ "i" ]`
115
115
*
116
116
* ```js
117
117
* for (var i = 0; i < array.length; i++) {}
@@ -205,11 +205,11 @@ module.exports.prototype = {
205
205
) ;
206
206
207
207
var wordDictionaries = [ 'english' ] ;
208
- var identifierAndPropertyWords ;
209
- var propertyWords ;
210
- var identifierAndPropertyNames ;
211
- var propertyNames ;
212
- var excluded ;
208
+ var allowedWords ;
209
+ var allowedPropertyWords ;
210
+ var allowedNames ;
211
+ var allowedPropertyNames ;
212
+ var excludedWords ;
213
213
214
214
function arrayOption ( option ) {
215
215
var value = options [ option ] ;
@@ -225,11 +225,11 @@ module.exports.prototype = {
225
225
226
226
if ( wasObject ) {
227
227
wordDictionaries = arrayOption ( 'dictionaries' ) || wordDictionaries ;
228
- identifierAndPropertyWords = arrayOption ( 'allowWordsInIdentifiersAndProperties ' ) ;
229
- propertyWords = arrayOption ( 'allowWordsInProperties' ) ;
230
- identifierAndPropertyNames = arrayOption ( 'allowNamesForIdentifiersAndProperties ' ) ;
231
- propertyNames = arrayOption ( 'allowNamesForProperties ' ) ;
232
- excluded = arrayOption ( 'excluded ' ) ;
228
+ allowedWords = arrayOption ( 'allowWords ' ) ;
229
+ allowedPropertyWords = arrayOption ( 'allowWordsInProperties' ) ;
230
+ allowedNames = arrayOption ( 'allowNames ' ) ;
231
+ allowedPropertyNames = arrayOption ( 'allowNamesAsProperties ' ) ;
232
+ excludedWords = arrayOption ( 'excludeWords ' ) ;
233
233
}
234
234
235
235
this . _wordDictionaries = wordDictionaries . map ( function ( language ) {
@@ -251,26 +251,26 @@ module.exports.prototype = {
251
251
}
252
252
return wordlist [ language ] ;
253
253
} ) ;
254
- if ( identifierAndPropertyWords ) {
255
- this . _wordDictionaries . push ( identifierAndPropertyWords ) ;
254
+ if ( allowedWords ) {
255
+ this . _wordDictionaries . push ( allowedWords ) ;
256
256
}
257
257
258
258
this . _propertyWordDictionaries = this . _wordDictionaries . slice ( ) ;
259
- if ( propertyWords ) {
260
- this . _propertyWordDictionaries . push ( propertyWords ) ;
259
+ if ( allowedPropertyWords ) {
260
+ this . _propertyWordDictionaries . push ( allowedPropertyWords ) ;
261
261
}
262
262
263
263
this . _nameDictionaries = [ ] ;
264
- if ( identifierAndPropertyNames ) {
265
- this . _nameDictionaries . push ( identifierAndPropertyNames ) ;
264
+ if ( allowedNames ) {
265
+ this . _nameDictionaries . push ( allowedNames ) ;
266
266
}
267
267
268
268
this . _propertyNameDictionaries = this . _nameDictionaries . slice ( ) ;
269
- if ( propertyNames ) {
270
- this . _propertyNameDictionaries . push ( propertyNames ) ;
269
+ if ( allowedPropertyNames ) {
270
+ this . _propertyNameDictionaries . push ( allowedPropertyNames ) ;
271
271
}
272
272
273
- this . _excluded = excluded ;
273
+ this . _excludedWords = excludedWords ;
274
274
} ,
275
275
276
276
getOptionName : function ( ) {
@@ -284,7 +284,7 @@ module.exports.prototype = {
284
284
if ( ! dictionariesHaveWord ( nameDictionaries , name ) ) {
285
285
checkWords (
286
286
wordDictionaries ,
287
- _this . _excluded ,
287
+ _this . _excludedWords ,
288
288
errors ,
289
289
name ,
290
290
start
0 commit comments