You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 1, 2022. It is now read-only.
Added options to configure number of grid cols and screen names through options param. Fixes various false positives when linting custom built bootstrap.
Use the following [bookmarklet](https://en.wikipedia.org/wiki/Bookmarklet) that's powered by [BootstrapCDN](https://www.bootstrapcdn.com/bootlint/):
@@ -118,12 +128,18 @@ A ***reporter*** is a function that accepts exactly 1 argument of type `LintWarn
118
128
Bootlint exports a `bootlint` property on the global `window` object.
119
129
In a browser environment, the following public APIs are available:
120
130
121
-
*`bootlint.lintCurrentDocument(reporter, disabledIds)`: Lints the HTML of the current document and calls the `reporter()` function repeatedly with each lint problem as an argument.
131
+
*`bootlint.lintCurrentDocument(reporter, options)`: Lints the HTML of the current document and calls the `reporter()` function repeatedly with each lint problem as an argument.
122
132
*`reporter` is a *reporter* function (see above for a definition). It will be called repeatedly with each lint problem as an argument.
123
-
*`disabledIds` is an array of string linter IDs to disable
133
+
*`options` is an optional object of configuration options
134
+
*`cols` is number of bootstrap columns
135
+
*`disabledIds` is an array of string linter IDs to disable
136
+
*`screens` is an array of custom screen sizes (e.g. `['xxs', 'xs', 'sm', 'md', 'lg', 'xlg']`)
124
137
* Returns nothing (i.e. `undefined`)
125
138
*`bootlint.showLintReportForCurrentDocument(disabledIds, alertOpts)`: Lints the HTML of the current document and reports the linting results to the user. Each warning will be output individually using `console.warn()`.
126
-
*`disabledIds` is an array of string linter IDs to disable
139
+
*`options` is an optional object of configuration options
140
+
*`cols` is number of bootstrap columns
141
+
*`disabledIds` is an array of string linter IDs to disable
142
+
*`screens` is an array of custom screen sizes (e.g. `['xxs', 'xs', 'sm', 'md', 'lg', 'xlg']`)
127
143
*`alertOpts` is an optional options object with the following properties:
128
144
*`hasProblems` (type: `boolean`; default: `true`) - `window.alert()` a single general notification message to the user if there are any lint problems?
129
145
*`problemFree` (type: `boolean`; default: `true`) - `window.alert()` a notification message to the user if the document has no lint problems?
@@ -140,15 +156,18 @@ function reporter(lint) {
140
156
console.log(lint.id, lint.message);
141
157
}
142
158
143
-
bootlint.lintHtml("<!DOCTYPE html><html>...", reporter, []); // calls reporter() repeatedly with each lint problem as an argument
159
+
bootlint.lintHtml("<!DOCTYPE html><html>...", reporter); // calls reporter() repeatedly with each lint problem as an argument
144
160
```
145
161
146
162
In a Node.js environment, Bootlint exposes the following public API:
147
163
148
-
*`bootlint.lintHtml(html, reporter, disabledIds)`: Lints the given HTML for a webpage and returns the linting results.
164
+
*`bootlint.lintHtml(html, reporter, options)`: Lints the given HTML for a webpage and returns the linting results.
149
165
*`html` is the HTML to lint, as a string
150
166
*`reporter` is a *reporter* function (see above for a definition). It will be called repeatedly with each lint problem as an argument.
151
-
*`disabledIds` is an array of string linter IDs to disable
167
+
*`options` is an optional object of configuration options
168
+
*`cols` is number of bootstrap columns
169
+
*`disabledIds` is an array of string linter IDs to disable
170
+
*`screens` is an array of custom screen sizes (e.g. `['xxs', 'xs', 'sm', 'md', 'lg', 'xlg']`)
0 commit comments