Skip to content

Commit 03f40ec

Browse files
committed
Update dependencies
1 parent 61f15ba commit 03f40ec

File tree

7 files changed

+98
-190
lines changed

7 files changed

+98
-190
lines changed

.eslintrc.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
root: true
2+
extends: eslint:recommended
3+
4+
parserOptions:
5+
ecmaVersion: 5
6+
7+
env:
8+
commonjs: true
9+
10+
rules:
11+
indent: [2, 2] # 2 spaces indentation
12+
max-len: [2, 80, 2]
13+
quotes: [2, "double"]
14+
semi: [2, "never"]
15+
no-multiple-empty-lines: [2, {"max": 1}]
16+
17+
brace-style: [2, "stroustrup"]
18+
comma-dangle: [2, "always-multiline"]
19+
comma-style: [2, "last"]
20+
dot-location: [2, "property"]
21+
22+
one-var: [2, "never"]
23+
# no-var: [2]
24+
prefer-const: [2]
25+
no-bitwise: [2]
26+
27+
object-curly-spacing: [2, "never"]
28+
array-bracket-spacing: [2, "never"]
29+
computed-property-spacing: [2, "never"]
30+
31+
space-unary-ops: [2, {"words": true, "nonwords": false}]
32+
keyword-spacing: [2, {"before": true, "after": true}]
33+
space-before-blocks: [2, "always"]
34+
space-before-function-paren: [2, "never"]
35+
space-in-parens: [2, "never"]
36+
spaced-comment: [2, "always"]

.jscsrc

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

.jshintrc

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

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
sudo: false
12
language: node_js
23
node_js:
3-
- iojs
4+
- "6"
5+
- "4"

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = postcss.plugin("postcss-color-function", function() {
2424
message:
2525
"Skipped color function with custom property `" +
2626
decl.value +
27-
"`"
27+
"`",
2828
})
2929
return
3030
}
@@ -33,7 +33,8 @@ module.exports = postcss.plugin("postcss-color-function", function() {
3333
decl.value = helpers.try(function transformColorValue() {
3434
return transformColor(decl.value)
3535
}, decl.source)
36-
} catch (error) {
36+
}
37+
catch (error) {
3738
decl.warn(result, error.message, {
3839
word: decl.value,
3940
index: decl.index,

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,18 @@
1717
"index.js"
1818
],
1919
"dependencies": {
20-
"css-color-function": "^1.2.0",
21-
"postcss": "^5.0.4",
20+
"css-color-function": "^1.3.0",
21+
"postcss": "^6.0.1",
2222
"postcss-message-helpers": "^2.0.0",
2323
"postcss-value-parser": "^3.3.0"
2424
},
2525
"devDependencies": {
26-
"jscs": "^1.6.2",
27-
"jshint": "^2.5.6",
26+
"eslint": "^3.19.0",
2827
"npmpub": "^3.1.0",
2928
"tape": "^3.0.0"
3029
},
3130
"scripts": {
32-
"lint": "jscs *.js **/*.js && jshint . --exclude-path .gitignore",
31+
"lint": "eslint *.js index.js ./test/",
3332
"test": "npm run lint && tape test",
3433
"release": "npmpub"
3534
}

test/index.js

Lines changed: 52 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@ var test = require("tape")
55
var postcss = require("postcss")
66
var plugin = require("..")
77

8-
function filename(name) { return "test/" + name + ".css" }
9-
function read(name) { return fs.readFileSync(name, "utf8") }
8+
function filename(name) {
9+
return "test/" + name + ".css"
10+
}
11+
12+
function read(name) {
13+
return fs.readFileSync(name, "utf8")
14+
}
1015

1116
function compareFixtures(t, name, msg, opts, postcssOpts) {
1217
postcssOpts = postcssOpts || {}
1318
postcssOpts.from = filename("fixtures/" + name)
1419
opts = opts || {}
15-
var actual = postcss().use(plugin(opts)).process(read(postcssOpts.from), postcssOpts).css
20+
var actual = postcss().use(plugin(opts))
21+
.process(read(postcssOpts.from), postcssOpts).css
1622
var expected = read(filename("fixtures/" + name + ".expected"))
1723
fs.writeFile(filename("fixtures/" + name + ".actual"), actual)
1824
t.equal(actual, expected, msg)
@@ -26,8 +32,8 @@ test("color()", function(t) {
2632
test("logs warning when color() value cannot be parsed", function(t) {
2733
postcss(plugin()).process(read(filename("fixtures/error")))
2834
.then(function(result) {
29-
var warnings = result.warnings();
30-
t.equals(warnings.length, 1, "expected only 1 warning");
35+
var warnings = result.warnings()
36+
t.equals(warnings.length, 1, "expected only 1 warning")
3137

3238
var warning = warnings[0]
3339
t.equals(
@@ -45,55 +51,58 @@ test("logs warning when color() value cannot be parsed", function(t) {
4551
t.equals(
4652
warning.text,
4753
"<css input>:2:3: Unable to parse color from string \"blurp\"",
48-
"expected `warning.text` to contain a readable error when a color can't be parsed"
54+
"expected `warning.text` to contain a readable error " +
55+
"when a color can't be parsed"
4956
)
5057

5158
t.end()
5259
})
5360
})
5461

5562
test("logs message when color() contains var() custom property", function(t) {
56-
postcss(plugin()).process(read(filename("fixtures/color-with-custom-properties")))
57-
.then(function(result) {
58-
const expectedWords = [
59-
"color(var(--red))",
60-
"color(var(--red) tint(50%))",
61-
"color(var(--red) tint(var(--tintPercent)))",
62-
"color(rgb(255, 0, 0) tint(var(--tintPercent)))"
63-
]
63+
postcss(plugin()).process(
64+
read(filename("fixtures/color-with-custom-properties"))
65+
).then(function(result) {
66+
var expectedWords = [
67+
"color(var(--red))",
68+
"color(var(--red) tint(50%))",
69+
"color(var(--red) tint(var(--tintPercent)))",
70+
"color(rgb(255, 0, 0) tint(var(--tintPercent)))",
71+
]
72+
73+
t.equal(
74+
result.messages.length,
75+
expectedWords.length,
76+
"expected a message every time a color function is skipped"
77+
)
78+
79+
result.messages.forEach(function(message, i) {
80+
t.equal(
81+
message.type,
82+
"skipped-color-function-with-custom-property",
83+
"expected `message.type` to indicate reason for message"
84+
)
6485

6586
t.equal(
66-
result.messages.length,
67-
expectedWords.length,
68-
"expected a message every time a color function is skipped"
87+
message.plugin,
88+
"postcss-color-function",
89+
"expected `message.plugin` to match this plugin's name"
6990
)
7091

71-
result.messages.forEach(function(message, i) {
72-
t.equal(
73-
message.type,
74-
"skipped-color-function-with-custom-property",
75-
"expected `message.type` to indicate reason for message"
76-
)
77-
78-
t.equal(
79-
message.plugin,
80-
"postcss-color-function",
81-
"expected `message.plugin` to match this plugin's name"
82-
)
83-
84-
t.equal(
85-
message.word,
86-
expectedWords[i],
87-
"expected `message.word` to contain declaration value"
88-
)
89-
90-
t.equal(
91-
message.message,
92-
"Skipped color function with custom property `" + expectedWords[i] + "`",
93-
"expected `message.message` to contain reason for message"
94-
)
95-
})
92+
t.equal(
93+
message.word,
94+
expectedWords[i],
95+
"expected `message.word` to contain declaration value"
96+
)
9697

97-
t.end()
98+
t.equal(
99+
message.message,
100+
"Skipped color function with custom property " +
101+
"`" + expectedWords[i] + "`",
102+
"expected `message.message` to contain reason for message"
103+
)
98104
})
105+
106+
t.end()
107+
})
99108
})

0 commit comments

Comments
 (0)