Skip to content

Commit e5963b9

Browse files
committed
bump dependencies, adapt js to new linting standards
1 parent 7b7d7b6 commit e5963b9

File tree

6 files changed

+62
-47
lines changed

6 files changed

+62
-47
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules/
22
npm-debug.log
3+
package-lock.json

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: node_js
22
node_js:
3-
- 4
4-
- 5
53
- 6
64
- 7
5+
- 8
6+
- 9
7+
- 10

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.0
2+
* Use PostCSS 7.x
3+
* Bump various dependencies
4+
15
## 2.0
26
* Use PostCSS 6.x
37
* Use Node 4.x syntax

index.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
const postcss = require('postcss');
1+
var postcss = require('postcss')
22

3-
module.exports = postcss.plugin('postcss-replace-overflow-wrap', (opts) => {
4-
opts = opts || {};
5-
const method = opts.method || 'replace';
3+
module.exports = postcss.plugin('postcss-replace-overflow-wrap', function (opts) {
4+
opts = opts || {}
5+
var method = opts.method || 'replace'
66

7-
return (css) => {
8-
css.walkDecls('overflow-wrap', (decl) => {
9-
decl.cloneBefore({ prop: 'word-wrap' });
10-
if (method === 'replace') {
11-
decl.remove();
12-
}
13-
});
14-
};
15-
});
7+
return function (css) {
8+
css.walkDecls('overflow-wrap', function (decl) {
9+
decl.cloneBefore({ prop: 'word-wrap' })
10+
if (method === 'replace') {
11+
decl.remove()
12+
}
13+
})
14+
}
15+
})

package.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,27 @@
2323
"postcss": "^7.0.2"
2424
},
2525
"devDependencies": {
26-
"ava": "^0.19.1",
27-
"eslint": "^3.19.0",
28-
"eslint-config-postcss": "^2.0.2"
26+
"ava": "^0.25.0",
27+
"eslint": "^5.3.0",
28+
"eslint-config-logux": "^24.0.0",
29+
"eslint-config-postcss": "^3.0.3",
30+
"eslint-config-standard": "^11.0.0",
31+
"eslint-plugin-es5": "^1.3.1",
32+
"eslint-plugin-import": "^2.13.0",
33+
"eslint-plugin-jest": "^21.20.1",
34+
"eslint-plugin-node": "^7.0.1",
35+
"eslint-plugin-promise": "^3.8.0",
36+
"eslint-plugin-security": "^1.4.0",
37+
"eslint-plugin-standard": "^3.1.0"
2938
},
3039
"scripts": {
3140
"test": "ava && eslint *.js"
3241
},
3342
"eslintConfig": {
3443
"extends": "eslint-config-postcss/es5",
3544
"rules": {
36-
"max-len": 0
45+
"max-len": 0,
46+
"es5/no-modules": false
3747
}
3848
}
3949
}

test.js

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
1-
import postcss from 'postcss';
2-
import test from 'ava';
1+
import postcss from 'postcss'
2+
import test from 'ava'
33

4-
import plugin from './';
4+
import plugin from './'
55

6-
function run(t, input, output, opts = { }) {
7-
return postcss([ plugin(opts) ]).process(input)
8-
.then( result => {
9-
t.deepEqual(result.css, output);
10-
t.deepEqual(result.warnings().length, 0);
11-
});
6+
function run (t, input, output, opts = { }) { //eslint-disable-line
7+
return postcss([plugin(opts)]).process(input)
8+
.then(function (result) {
9+
t.deepEqual(result.css, output)
10+
t.deepEqual(result.warnings().length, 0)
11+
})
1212
}
1313

14+
test('replace overflow-wrap with word-wrap, no options', function (t) {
15+
return run(t,
16+
'.someClass{ overflow-wrap: break-word; }',
17+
'.someClass{ word-wrap: break-word; }'
18+
, {})
19+
})
1420

15-
test('replace overflow-wrap with word-wrap, no options', t => {
16-
return run(t,
17-
'.someClass{ overflow-wrap: break-word; }',
18-
'.someClass{ word-wrap: break-word; }'
19-
, {});
20-
});
21+
test('add word-wrap right before overflow-wrap due to passed arg', function (t) {
22+
return run(t,
23+
'.anotherClass{font-size:1rem;overflow-wrap:break-word;}',
24+
'.anotherClass{font-size:1rem;word-wrap:break-word;overflow-wrap:break-word;}'
25+
, { method: 'copy' })
26+
})
2127

22-
test('add word-wrap right before overflow-wrap due to passed arg', t => {
23-
return run(t,
24-
'.anotherClass{font-size:1rem;overflow-wrap:break-word;}',
25-
'.anotherClass{font-size:1rem;word-wrap:break-word;overflow-wrap:break-word;}'
26-
, { method: 'copy' });
27-
});
28-
29-
test('replace overflow-wrap with word-wrap, replace method', t => {
30-
return run(t,
31-
'main { overflow-wrap: normal; }',
32-
'main { word-wrap: normal; }'
33-
, { method: 'replace' });
34-
});
28+
test('replace overflow-wrap with word-wrap, replace method', function (t) {
29+
return run(t,
30+
'main { overflow-wrap: normal; }',
31+
'main { word-wrap: normal; }'
32+
, { method: 'replace' })
33+
})

0 commit comments

Comments
 (0)