Skip to content

Commit fbeb641

Browse files
Docs: Add error suppression documentation
1 parent bab7e5a commit fbeb641

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,28 @@ var data = { videoSrc: 'youtube' };
171171
```js
172172
for (var i = 0; i < array.length; i++) {}
173173
```
174+
175+
#### Error Suppression
176+
177+
You can also allow (and later disallow) words on a per-file (or per-line)
178+
basis:
179+
180+
```js
181+
// jscs:allowWords concat, dest, dist, src
182+
grunt.initConfig({
183+
concat: {
184+
dist: {
185+
src: ['src/*.js'],
186+
dest: 'dist/scripts.js'
187+
}
188+
}
189+
});
190+
```
191+
192+
```js
193+
// jscs:allowNamesAsIdentifiers EOL
194+
var EOL = require('os').EOL;
195+
// jscs:disallowNamesAsIdentifiers EOL
196+
197+
if (age > 80) var reachingEol = true; // invalid
198+
```

lib/rules/require-dictionary-words.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,31 @@
118118
* ```js
119119
* for (var i = 0; i < array.length; i++) {}
120120
* ```
121+
*
122+
* #### Error Suppression
123+
*
124+
* You can also allow (and later disallow) words on a per-file (or per-line)
125+
* basis:
126+
*
127+
* ```js
128+
* // jscs:allowWords concat, dest, dist, src
129+
* grunt.initConfig({
130+
* concat: {
131+
* dist: {
132+
* src: ['src/*.js'],
133+
* dest: 'dist/scripts.js'
134+
* }
135+
* }
136+
* });
137+
* ```
138+
*
139+
* ```js
140+
* // jscs:allowNamesAsIdentifiers EOL
141+
* var EOL = require('os').EOL;
142+
* // jscs:disallowNamesAsIdentifiers EOL
143+
*
144+
* if (age > 80) var reachingEol = true; // invalid
145+
* ```
121146
*/
122147

123148
var assert = require('assert');

0 commit comments

Comments
 (0)