Skip to content

Commit 4d55fb4

Browse files
committed
chore(lint): switch to semistandard
1 parent f823745 commit 4d55fb4

File tree

7 files changed

+143
-621
lines changed

7 files changed

+143
-621
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![npm version](https://badge.fury.io/js/stylelint-webpack-plugin.svg)](https://badge.fury.io/js/stylelint-webpack-plugin)
33
[![Build Status](https://travis-ci.org/JaKXz/stylelint-webpack-plugin.svg?branch=master)](https://travis-ci.org/JaKXz/stylelint-webpack-plugin)
44
[![Coverage Status](https://coveralls.io/repos/github/JaKXz/stylelint-webpack-plugin/badge.svg?branch=master)](https://coveralls.io/github/JaKXz/stylelint-webpack-plugin?branch=master)
5-
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
5+
[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-red.svg)](https://github.com/Flet/semistandard)
66
[![Gitter](https://badges.gitter.im/stylelint-webpack-plugin/Lobby.svg)](https://gitter.im/stylelint-webpack-plugin/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
77

88
> ## Why you might want to use this plugin instead of [stylelint-loader](https://github.com/adrianhall/stylelint-loader)

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var formatter = require('stylelint').formatters.string;
99
// Modules
1010
var runCompilation = require('./lib/run-compilation');
1111

12-
function apply(options, compiler) {
12+
function apply (options, compiler) {
1313
options = options || {};
1414
var context = options.context || compiler.context;
1515

@@ -28,7 +28,7 @@ function apply(options, compiler) {
2828
var runner = runCompilation.bind(this, options);
2929

3030
compiler.plugin('run', runner);
31-
compiler.plugin('watch-run', function onWatchRun(watcher, callback) {
31+
compiler.plugin('watch-run', function onWatchRun (watcher, callback) {
3232
runner(watcher.compiler, callback);
3333
});
3434
}
@@ -39,7 +39,7 @@ function apply(options, compiler) {
3939
* @param options - from webpack config, see defaults in `apply` function.
4040
* @return {Object} the bound apply function
4141
*/
42-
module.exports = function stylelintWebpackPlugin(options) {
42+
module.exports = function stylelintWebpackPlugin (options) {
4343
return {
4444
apply: apply.bind(this, options)
4545
};

lib/linter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Dependencies
44
var stylelint = require('stylelint');
55

6-
function lint(options) {
6+
function lint (options) {
77
return stylelint.lint(options);
88
}
99

lib/run-compilation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ var linter = require('./linter');
1010
* @param compiler - the compiler object
1111
* @param done - webpack callback
1212
*/
13-
module.exports = function runCompilation(options, compiler, done) {
13+
module.exports = function runCompilation (options, compiler, done) {
1414
var errors = [];
1515
var warnings = [];
1616

1717
linter(options)
18-
.then(function linterSuccess(lint) {
18+
.then(function linterSuccess (lint) {
1919
var results = lint.results;
2020

2121
warnings = results.filter(function (file) {
@@ -38,7 +38,7 @@ module.exports = function runCompilation(options, compiler, done) {
3838
})
3939
.catch(done);
4040

41-
compiler.plugin('compilation', function onCompilation(compilation) {
41+
compiler.plugin('compilation', function onCompilation (compilation) {
4242
if (warnings.length) {
4343
compilation.warnings.push(chalk.yellow(options.formatter(warnings)));
4444
warnings = [];

package.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
"mocha": "^3.1.0",
4646
"npm-install-version": "^6.0.1",
4747
"nyc": "^10.0.0",
48-
"xo": "^0.16.0"
48+
"semistandard": "^9.2.1"
4949
},
5050
"scripts": {
51-
"pretest": "xo",
51+
"pretest": "semistandard",
5252
"test:webpack1": "WEBPACK_VERSION=1 nyc mocha",
5353
"test:webpack2": "WEBPACK_VERSION=beta nyc mocha",
5454
"test": "npm run test:webpack1 && npm run test:webpack2",
@@ -61,8 +61,7 @@
6161
"text-summary"
6262
]
6363
},
64-
"xo": {
65-
"space": true,
64+
"semistandard": {
6665
"envs": [
6766
"node",
6867
"mocha"
@@ -71,10 +70,5 @@
7170
"getPath",
7271
"expect"
7372
]
74-
},
75-
"greenkeeper": {
76-
"ignore": [
77-
"xo"
78-
]
7973
}
8074
}

test/helpers/pack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var webpack = require('./webpack');
88
* @param testConfig - the plugin config being tested run through the webpack compiler
99
* @return {Promise} - rejects with both stats and the error if needed
1010
*/
11-
module.exports = function pack(testConfig) {
11+
module.exports = function pack (testConfig) {
1212
return new Promise(function (resolve, reject) {
1313
var compiler = webpack(testConfig);
1414
compiler.outputFileSystem = new MemoryFileSystem();

0 commit comments

Comments
 (0)