Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit 7a28eab

Browse files
authored
Merge pull request #33 from stylelint/use-shared-configs
Use shared configs
2 parents d5283cf + d2b4242 commit 7a28eab

13 files changed

+2080
-809
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test/fixtures/*
2+
coverage/**
3+
.nyc_output/**

.prettierrc.js

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

camel-case.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function camelCase(str) {
66
? s
77
.replace(/^-(ms|moz|khtml|epub|(\w+-?)*webkit)(?=-)/i, '$1')
88
.replace(/-\w/g, (s) => s[1].toUpperCase())
9-
: s
9+
: s,
1010
);
1111
}
1212

extract.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,11 @@ function literalParser(source, opts, styles) {
201201
}
202202

203203
function setSpecifier(id, nameSpace) {
204-
nameSpace.unshift.apply(
205-
nameSpace,
206-
nameSpace
204+
nameSpace.unshift(
205+
...nameSpace
207206
.shift()
208207
.replace(/^\W+/, '')
209-
.split(/[/\\]+/g)
208+
.split(/[/\\]+/g),
210209
);
211210

212211
if (types.isIdentifier(id)) {
@@ -240,7 +239,7 @@ function literalParser(source, opts, styles) {
240239
const specifier = specifiers.get(node) || specifiers.get(node.name);
241240

242241
if (specifier) {
243-
nameSpace.unshift.apply(nameSpace, specifier);
242+
nameSpace.unshift(...specifier);
244243
} else {
245244
nameSpace.unshift(node.name);
246245
}
@@ -254,7 +253,7 @@ function literalParser(source, opts, styles) {
254253
}
255254

256255
function isStylePath(path) {
257-
return getNameSpace(path, []).some(function (name) {
256+
return getNameSpace(path, []).some(function (name, ...args) {
258257
const result =
259258
name &&
260259
((Object.prototype.hasOwnProperty.call(supports, name) && supports[name]) ||
@@ -263,11 +262,14 @@ function literalParser(source, opts, styles) {
263262

264263
switch (typeof result) {
265264
case 'function': {
266-
return result.apply(this, Array.prototype.slice.call(arguments, 1));
265+
return result.apply(this, args);
267266
}
268267
case 'boolean': {
269268
return result;
270269
}
270+
default: {
271+
return undefined;
272+
}
271273
}
272274
});
273275
}
@@ -432,8 +434,8 @@ function literalParser(source, opts, styles) {
432434
(targetStyle) =>
433435
targetStyle.opts &&
434436
targetStyle.opts.expressions.some(
435-
(expr) => expr.start <= style.startIndex && style.endIndex < expr.end
436-
)
437+
(expr) => expr.start <= style.startIndex && style.endIndex < expr.end,
438+
),
437439
);
438440

439441
if (target) {

object-parser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function defineRaws(node, prop, prefix, suffix, props) {
4848
prefix,
4949
suffix,
5050
},
51-
props
51+
props,
5252
);
5353
}
5454

@@ -85,7 +85,7 @@ class objectParser {
8585

8686
let before = root.source.input.css.slice(
8787
startNode.start - startNode.loc.start.column,
88-
startNode.start
88+
startNode.start,
8989
);
9090

9191
if (/^\s+$/.test(before)) {

0 commit comments

Comments
 (0)