Skip to content

Commit acfa2f3

Browse files
authored
Merge pull request #24 from tschortsch/bootlint-v1.0.0
Update bootlint to v1.0.0
2 parents d9b9d58 + 83ac568 commit acfa2f3

File tree

8 files changed

+1060
-1387
lines changed

8 files changed

+1060
-1387
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
end_of_line = lf
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "gulp",
3+
"rules": {
4+
"max-len": 0,
5+
"space-before-function-paren": ["error", "always"]
6+
}
7+
}

.eslintrc.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ After installing the plugin you can create a new gulp task in your `gulpfile.js`
2626

2727
```javascript
2828
var gulp = require('gulp');
29-
var bootlint = require('gulp-bootlint');
29+
var bootlint = require('gulp-bootlint');
3030

3131
gulp.task('bootlint', function() {
32-
return gulp.src('./index.html')
33-
.pipe(bootlint());
32+
return gulp.src('./index.html')
33+
.pipe(bootlint());
3434
});
3535
```
3636

@@ -52,14 +52,6 @@ Stops the gulp task if there are errors in the linted file.
5252

5353
Stops the gulp task if there are warnings in the linted file.
5454

55-
### options.loglevel
56-
57-
* Type: `String`
58-
* Default: `'error'`
59-
* Options: `'emergency'`, `'alert'`, `'critical'`, `'error'`, `'warning'`, `'notice'`, `'info'`, `'debug'`
60-
61-
Defines which log messages should be printed to `stdout`.
62-
6355
### options.disabledIds
6456

6557
* Type: `String[]`
@@ -105,40 +97,54 @@ If desired, this can be turned off entirely by setting `summaryReportFn: false`.
10597

10698
```javascript
10799
var gulp = require('gulp');
108-
var bootlint = require('gulp-bootlint');
109-
110-
gulp.task('bootlint', function() {
111-
var fileIssues = [];
112-
return gulp.src('./index.html')
113-
.pipe(bootlint({
114-
stoponerror: true,
115-
stoponwarning: true,
116-
loglevel: 'debug',
117-
disabledIds: ['W009', 'E007'],
118-
issues: fileIssues,
119-
reportFn: function(file, lint, isError, isWarning, errorLocation) {
120-
var message = (isError) ? "ERROR! - " : "WARN! - ";
121-
if (errorLocation) {
122-
message += file.path + ' (line:' + (errorLocation.line + 1) + ', col:' + (errorLocation.column + 1) + ') [' + lint.id + '] ' + lint.message;
123-
} else {
124-
message += file.path + ': ' + lint.id + ' ' + lint.message;
125-
}
126-
console.log(message);
127-
},
128-
summaryReportFn: function(file, errorCount, warningCount) {
129-
if (errorCount > 0 || warningCount > 0) {
130-
console.log("please fix the " + errorCount + " errors and "+ warningCount + " warnings in " + file.path);
131-
} else {
132-
console.log("No problems found in "+ file.path);
133-
}
134-
}
135-
}));
100+
var bootlint = require('gulp-bootlint');
101+
102+
gulp.task('bootlint', function () {
103+
var fileIssues = [];
104+
return gulp.src('./index.html')
105+
.pipe(bootlint({
106+
stoponerror: true,
107+
stoponwarning: true,
108+
disabledIds: ['W009', 'E007'],
109+
issues: fileIssues,
110+
reportFn: function (file, lint, isError, isWarning, errorLocation) {
111+
var message = (isError) ? 'ERROR! - ' : 'WARN! - ';
112+
if (errorLocation) {
113+
message += file.path + ' (line:' + (errorLocation.line + 1) + ', col:' + (errorLocation.column + 1) + ') [' + lint.id + '] ' + lint.message;
114+
} else {
115+
message += file.path + ': ' + lint.id + ' ' + lint.message;
116+
}
117+
console.log(message);
118+
},
119+
summaryReportFn: function(file, errorCount, warningCount) {
120+
if (errorCount > 0 || warningCount > 0) {
121+
console.log('please fix the ' + errorCount + ' errors and ' + warningCount + ' warnings in ' + file.path);
122+
} else {
123+
console.log('No problems found in ' + file.path);
124+
}
125+
},
126+
}));
136127
});
137128
```
138129

139-
## Release History
130+
## Log level
131+
132+
To set the log level please use the `LOG_LEVEL` environment variable before starting your gulp task:
133+
134+
```
135+
$ LOG_LEVEL=error npm run gulp
136+
```
137+
138+
Available log levels are listed here: https://github.com/medikoo/log#available-log-levels
139+
140+
## Changelog
140141

141-
* 2019-XX-XX - v0.11.1: Bumped dependency versions
142+
* 2019-12-12 - v1.0.0
143+
* Updated `bootlint` to v1.0.0
144+
* Updated `log` package to v6.0.0
145+
* Dropped `loglevel` option since it's not supported anymore by the new `log` package.
146+
To set the log level please use the `LOG_LEVEL` environment variable before running your gulp task (see: https://github.com/tschortsch/gulp-bootlint#log-level).
147+
* Bumped other dependency versions
142148
* 2019-06-26 - v0.11.0
143149
* **Dropped support for Node.js versions <= 7**
144150
* Updated Bootlint to v0.16.6

0 commit comments

Comments
 (0)