Skip to content

Commit 2fd0c78

Browse files
committed
ci(Travis): updates Travis validations
- Validate against current node versions - Test against both Webpack 1.4.x & 2.2.x - Remove deprecated .eslintrc - .eslint.yml generated from current code ( no changes ) - add yarn lock file set to binary in git - ignores console for eslint in test helpers
1 parent e54549e commit 2fd0c78

File tree

8 files changed

+2386
-28
lines changed

8 files changed

+2386
-28
lines changed

.eslintrc

-10
This file was deleted.

.eslintrc.yml

+247
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
env:
2+
es6: true
3+
node: true
4+
extends: 'eslint:recommended'
5+
parserOptions:
6+
sourceType: module
7+
rules:
8+
accessor-pairs: error
9+
array-bracket-spacing: 'off'
10+
array-callback-return: error
11+
arrow-body-style: error
12+
arrow-parens: error
13+
arrow-spacing: error
14+
block-scoped-var: 'off'
15+
block-spacing:
16+
- error
17+
- always
18+
brace-style:
19+
- error
20+
- 1tbs
21+
- allowSingleLine: true
22+
callback-return: 'off'
23+
camelcase:
24+
- error
25+
- properties: never
26+
capitalized-comments: 'off'
27+
class-methods-use-this: error
28+
comma-dangle: 'off'
29+
comma-spacing:
30+
- error
31+
- after: true
32+
before: false
33+
comma-style:
34+
- error
35+
- last
36+
complexity: error
37+
computed-property-spacing:
38+
- error
39+
- never
40+
consistent-return: 'off'
41+
consistent-this: error
42+
curly: 'off'
43+
default-case: 'off'
44+
dot-location: error
45+
dot-notation:
46+
- error
47+
- allowKeywords: true
48+
eol-last: error
49+
eqeqeq: 'off'
50+
func-call-spacing: error
51+
func-name-matching: 'off'
52+
func-names: 'off'
53+
func-style:
54+
- error
55+
- declaration
56+
generator-star-spacing: error
57+
global-require: 'off'
58+
guard-for-in: error
59+
handle-callback-err: error
60+
id-blacklist: error
61+
id-length: 'off'
62+
id-match: error
63+
indent: 'off'
64+
init-declarations: 'off'
65+
jsx-quotes: error
66+
key-spacing: error
67+
keyword-spacing: 'off'
68+
line-comment-position: 'off'
69+
linebreak-style:
70+
- error
71+
- unix
72+
lines-around-comment: error
73+
lines-around-directive: error
74+
max-depth: error
75+
max-len: 'off'
76+
max-lines: error
77+
max-nested-callbacks: error
78+
max-params: 'off'
79+
max-statements: 'off'
80+
max-statements-per-line: error
81+
multiline-ternary: 'off'
82+
new-cap: error
83+
new-parens: error
84+
newline-after-var: 'off'
85+
newline-before-return: 'off'
86+
newline-per-chained-call: 'off'
87+
no-alert: error
88+
no-array-constructor: error
89+
no-await-in-loop: error
90+
no-bitwise: error
91+
no-caller: error
92+
no-catch-shadow: error
93+
no-confusing-arrow: error
94+
no-continue: error
95+
no-div-regex: error
96+
no-duplicate-imports: error
97+
no-else-return: 'off'
98+
no-empty-function: error
99+
no-eq-null: 'off'
100+
no-eval: error
101+
no-extend-native: error
102+
no-extra-bind: error
103+
no-extra-label: error
104+
no-extra-parens: 'off'
105+
no-floating-decimal: error
106+
no-implicit-globals: error
107+
no-implied-eval: error
108+
no-inline-comments: 'off'
109+
no-inner-declarations:
110+
- error
111+
- functions
112+
no-invalid-this: 'off'
113+
no-iterator: error
114+
no-label-var: error
115+
no-labels: error
116+
no-lone-blocks: error
117+
no-lonely-if: error
118+
no-loop-func: error
119+
no-magic-numbers: 'off'
120+
no-mixed-operators: error
121+
no-mixed-requires: error
122+
no-multi-assign: error
123+
no-multi-spaces: 'off'
124+
no-multi-str: error
125+
no-multiple-empty-lines: error
126+
no-native-reassign: error
127+
no-negated-condition: 'off'
128+
no-negated-in-lhs: error
129+
no-nested-ternary: error
130+
no-new: error
131+
no-new-func: error
132+
no-new-object: error
133+
no-new-require: error
134+
no-new-wrappers: error
135+
no-octal-escape: error
136+
no-param-reassign: 'off'
137+
no-path-concat: error
138+
no-plusplus:
139+
- error
140+
- allowForLoopAfterthoughts: true
141+
no-process-env: error
142+
no-process-exit: error
143+
no-proto: error
144+
no-prototype-builtins: error
145+
no-restricted-globals: error
146+
no-restricted-imports: error
147+
no-restricted-modules: error
148+
no-restricted-properties: error
149+
no-restricted-syntax: error
150+
no-return-assign: error
151+
no-return-await: error
152+
no-script-url: error
153+
no-self-compare: error
154+
no-sequences: error
155+
no-shadow: error
156+
no-shadow-restricted-names: error
157+
no-spaced-func: error
158+
no-sync: 'off'
159+
no-tabs: 'off'
160+
no-template-curly-in-string: error
161+
no-ternary: 'off'
162+
no-throw-literal: error
163+
no-trailing-spaces:
164+
- error
165+
- skipBlankLines: true
166+
no-undef-init: error
167+
no-undefined: 'off'
168+
no-underscore-dangle: error
169+
no-unmodified-loop-condition: error
170+
no-unneeded-ternary: error
171+
no-unused-expressions: error
172+
no-use-before-define: 'off'
173+
no-useless-call: error
174+
no-useless-computed-key: error
175+
no-useless-concat: error
176+
no-useless-constructor: error
177+
no-useless-escape: error
178+
no-useless-rename: error
179+
no-useless-return: error
180+
no-var: 'off'
181+
no-void: error
182+
no-warning-comments: error
183+
no-whitespace-before-property: error
184+
no-with: error
185+
object-curly-newline: 'off'
186+
object-curly-spacing: 'off'
187+
object-property-newline:
188+
- error
189+
- allowMultiplePropertiesPerLine: true
190+
object-shorthand: 'off'
191+
one-var: 'off'
192+
one-var-declaration-per-line: error
193+
operator-assignment: error
194+
operator-linebreak: 'off'
195+
padded-blocks: 'off'
196+
prefer-arrow-callback: 'off'
197+
prefer-const: error
198+
prefer-destructuring:
199+
- error
200+
- array: false
201+
object: false
202+
prefer-numeric-literals: error
203+
prefer-promise-reject-errors: error
204+
prefer-reflect: 'off'
205+
prefer-rest-params: error
206+
prefer-spread: error
207+
prefer-template: 'off'
208+
quote-props: 'off'
209+
quotes: 'off'
210+
radix:
211+
- error
212+
- always
213+
require-await: error
214+
require-jsdoc: 'off'
215+
rest-spread-spacing: error
216+
semi: 'off'
217+
semi-spacing:
218+
- error
219+
- after: true
220+
before: false
221+
sort-imports: error
222+
sort-keys: 'off'
223+
sort-vars: error
224+
space-before-blocks: 'off'
225+
space-before-function-paren: 'off'
226+
space-in-parens:
227+
- error
228+
- never
229+
space-infix-ops: error
230+
space-unary-ops: error
231+
spaced-comment: 'off'
232+
strict: error
233+
symbol-description: error
234+
template-curly-spacing: error
235+
unicode-bom:
236+
- error
237+
- never
238+
valid-jsdoc: error
239+
vars-on-top: 'off'
240+
wrap-iife:
241+
- error
242+
- any
243+
wrap-regex: 'off'
244+
yield-star-spacing: error
245+
yoda:
246+
- error
247+
- never

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
yarn.lock -diff
2+
* text=auto
3+
bin/* eol=lf

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
2-
coverage
2+
coverage
3+
npm-debug.log

.travis.yml

+29-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,32 @@
11
sudo: false
22
language: node_js
3-
node_js:
4-
- "0.12"
5-
- "node"
6-
- "iojs"
7-
script: npm run travis
8-
3+
branches:
4+
only:
5+
- master
6+
matrix:
7+
fast_finish: true
8+
include:
9+
- os: linux
10+
node_js: "7"
11+
env: WEBPACK_VERSION="2.2.0" JOB_PART=lint
12+
- os: linux
13+
node_js: "6"
14+
env: WEBPACK_VERSION="2.2.0" JOB_PART=test
15+
- os: linux
16+
node_js: "4.7"
17+
env: WEBPACK_VERSION="2.2.0" JOB_PART=test
18+
- os: linux
19+
node_js: "7"
20+
env: WEBPACK_VERSION="2.2.0" JOB_PART=test
21+
- os: linux
22+
node_js: "4.7"
23+
env: WEBPACK_VERSION="1.14.0" JOB_PART=test
24+
before_install:
25+
- nvm --version
26+
- node --version
27+
before_script:
28+
- 'if [ "$WEBPACK_VERSION" ]; then yarn add webpack@^$WEBPACK_VERSION; fi'
29+
script:
30+
- yarn run travis:$JOB_PART
931
after_success:
10-
- cat ./coverage/lcov.info | node_modules/.bin/coveralls --verbose
11-
- cat ./coverage/coverage.json | node_modules/codecov.io/bin/codecov.io.js
12-
- rm -rf ./coverage
32+
- bash <(curl -s https://codecov.io/bash)

package.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"author": "Tobias Koppers @sokra",
55
"description": "css loader module for webpack",
66
"engines": {
7-
"node": ">=0.12.0"
7+
"node": ">=0.12.0 || >=4.3.0 <5.0.0 || >=5.10"
88
},
99
"files": ["index.js", "locals.js", "lib"],
1010
"dependencies": {
@@ -22,15 +22,18 @@
2222
"source-list-map": "^0.1.7"
2323
},
2424
"devDependencies": {
25-
"codecov.io": "^0.1.2",
26-
"coveralls": "^2.11.2",
25+
"codecov": "^1.0.1",
26+
"eslint": "3.14.0",
2727
"istanbul": "^0.4.5",
28-
"mocha": "^3.1.2",
29-
"should": "^11.1.1"
28+
"mocha": "^3.2.0",
29+
"should": "^11.1.2"
3030
},
3131
"scripts": {
3232
"test": "mocha",
33-
"travis": "npm run cover -- --report lcovonly",
33+
"test:cover": "npm run cover -- --report lcovonly",
34+
"lint": "eslint lib test",
35+
"travis:test": "npm run cover",
36+
"travis:lint": "npm run lint",
3437
"cover": "istanbul cover node_modules/mocha/bin/_mocha",
3538
"publish-patch": "mocha && npm version patch && git push && git push --tags && npm publish"
3639
},

test/helpers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function getEvaluated(output, modules) {
1919
return "{" + module + "}";
2020
});
2121
} catch(e) {
22-
console.error(output);
22+
console.error(output); // eslint-disable-line no-console
2323
throw e;
2424
}
2525
delete m.exports.toString;
@@ -71,7 +71,7 @@ exports.test = function test(name, input, result, query, modules) {
7171

7272
exports.testError = function test(name, input, onError) {
7373
it(name, function(done) {
74-
runLoader(cssLoader, input, undefined, {}, function(err, output) {
74+
runLoader(cssLoader, input, undefined, {}, function(err, output) { // eslint-disable-line no-unused-vars
7575
if (!err) {
7676
done(new Error('Expected error to be thrown'));
7777
} else {

0 commit comments

Comments
 (0)