Skip to content

Commit da47ab2

Browse files
committed
Enable lint option by default
Fixes #48
1 parent 42bf070 commit da47ab2

File tree

5 files changed

+9
-17
lines changed

5 files changed

+9
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### HEAD
22

3+
* Enable `lint` option by default
34
* Add `postcss-apply`
45
* Add `postcss-color-function`
56
* Add `debug` option to pass an `postcss-debug` instance

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Compiles CSS packages with:
1717
* [postcss-custom-media](https://github.com/postcss/postcss-custom-media)
1818
* [autoprefixer](https://github.com/postcss/autoprefixer)
1919

20-
Each imported file is linted with [postcss-bem-linter](https://github.com/postcss/postcss-bem-linter) and minification is provided by [cssnano](http://cssnano.co/). Code style can also be checked with [stylelint](http://stylelint.io/)
20+
Each imported file is linted with [postcss-bem-linter](https://github.com/postcss/postcss-bem-linter) and [stylelint](http://stylelint.io/). Minification is provided by [cssnano](http://cssnano.co/).
2121

2222
Additional plugins can be added via the configuration options.
2323

@@ -45,7 +45,7 @@ Options:
4545
-h, --help output usage information
4646
-V, --version output the version number
4747
-m, --minify minify output with cssnano
48-
-l, --lint ensure code adheres to the SUIT code style
48+
-L, --no-lint disable stylelint and postcss-bem-linter
4949
-i, --import-root [path] the root directory for imported css files
5050
-c, --config [path] a custom PostCSS config file
5151
-v, --verbose log verbose output for debugging
@@ -128,7 +128,7 @@ function debug(plugins) {
128128
##### `lint`
129129

130130
* Type: `Boolean`
131-
* Default: `false`
131+
* Default: `true`
132132

133133
Ensure code conforms to the [SUIT code style](https://github.com/suitcss/suit/blob/master/doc/STYLE.md)
134134
by using the [stylelint-config-suitcss](https://github.com/suitcss/stylelint-config-suitcss) package.
@@ -140,7 +140,6 @@ locally in your package.
140140

141141
```js
142142
{
143-
lint: true,
144143
stylelint: {
145144
extends: 'stylelint-config-suitcss',
146145
rules: {

bin/suitcss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ program
2020
.version(require('../package.json').version)
2121
.usage('[<input>] [<output>]')
2222
.option('-m, --minify', 'minify output with cssnano')
23-
.option('-l, --lint', 'ensure code adheres to the SUIT code style')
23+
.option('-L, --no-lint', 'disable stylelint and postcss-bem-linter')
2424
.option('-i, --import-root [path]', 'the root directory for imported css files')
2525
.option('-c, --config [path]', 'a custom PostCSS config file')
2626
.option('-v, --verbose', 'log verbose output for debugging')

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = preprocessor;
1717

1818
var defaults = {
1919
debug: identity,
20-
lint: false,
20+
lint: true,
2121
minify: false,
2222
use: [
2323
'postcss-easy-import',

test/test.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ describe('suitcss', function() {
6666
}).catch(done);
6767
});
6868

69-
it('should allow stylelint to be enabled', function() {
70-
var opts = mergeOptions({lint: true});
71-
expect(opts.lint).to.be.true;
69+
it('should allow stylelint to be disabled', function() {
70+
var opts = mergeOptions({lint: false});
71+
expect(opts.lint).to.be.false;
7272
});
7373

7474
it('should allow a minify option to be set', function() {
@@ -131,7 +131,6 @@ describe('suitcss', function() {
131131
describe('using the transform option in postcss-import', function() {
132132
it('should use a default transform function that just returns the css', function(done) {
133133
suitcss('@import "./util.css";', {
134-
lint: true,
135134
root: 'test/fixtures'
136135
}).then(function(result) {
137136
expect(result.css).to.equal('.u-img {\n border-radius: 50%;\n}');
@@ -144,7 +143,6 @@ describe('suitcss', function() {
144143
var transformStub = sinon.stub().returns('body { color: blue; }');
145144

146145
suitcss('@import "./util.css";', {
147-
lint: true,
148146
root: 'test/fixtures',
149147
'postcss-easy-import': {
150148
transform: transformStub
@@ -160,7 +158,6 @@ describe('suitcss', function() {
160158

161159
it('should also work with a promise returned from the custom transform function', function(done) {
162160
suitcss('@import "./util.css";', {
163-
lint: true,
164161
root: 'test/fixtures',
165162
'postcss-easy-import': {
166163
transform: function() {
@@ -189,7 +186,6 @@ describe('suitcss', function() {
189186

190187
it('should call the updateWatchTaskFiles function with the file paths', function(done) {
191188
suitcss('@import "./util.css";', {
192-
lint: true,
193189
root: 'test/fixtures'
194190
}).then(function() {
195191
expect(updateWatchTaskFilesSpy.getCall(0).args[0][0]).to.contain('util.css');
@@ -202,7 +198,6 @@ describe('suitcss', function() {
202198
var onImportSpy = sinon.spy();
203199

204200
suitcss('@import "./util.css";', {
205-
lint: true,
206201
root: 'test/fixtures',
207202
'postcss-easy-import': {
208203
onImport: onImportSpy
@@ -259,7 +254,6 @@ describe('suitcss', function() {
259254
it('should lint the component', function() {
260255
return expect(
261256
suitcss(read('fixtures/component'), {
262-
lint: true,
263257
root: 'test/fixtures',
264258
'postcss-reporter': {
265259
throwError: true
@@ -271,7 +265,6 @@ describe('suitcss', function() {
271265
it('should allow the config to be overidden', function() {
272266
return expect(
273267
suitcss('@import "./stylelint.css"', {
274-
lint: true,
275268
root: 'test/fixtures',
276269
stylelint: {
277270
extends: 'stylelint-config-suitcss',
@@ -289,7 +282,6 @@ describe('suitcss', function() {
289282
it('should throw an error if stylelint fails', function() {
290283
return expect(
291284
suitcss('@import "./stylelint.css"', {
292-
lint: true,
293285
root: 'test/fixtures',
294286
'postcss-reporter': {
295287
throwError: true

0 commit comments

Comments
 (0)