Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

Commit 3ac3463

Browse files
author
Walker
committed
Fix lint issues
1 parent a916f9d commit 3ac3463

File tree

6 files changed

+22
-17
lines changed

6 files changed

+22
-17
lines changed

.eslintrc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
2-
"root": true,
3-
"extends": [
4-
"finn",
5-
"finn/node"
6-
]
7-
}
2+
"root": true,
3+
"parserOptions": {
4+
"ecmaVersion": 2017
5+
},
6+
"extends": ["finn", "finn/node"],
7+
"env": {
8+
"node": true
9+
}
10+
}

lib/util.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ const readPkgUp = require('read-pkg-up');
99
const postcss = require('postcss');
1010
const atImport = require('postcss-import');
1111

12-
module.exports.identifyCssModule = async function identifyCssModule(filePath) {
12+
module.exports.identifyCssModule = async function identifyCssModule (filePath) {
1313
const { pkg: { name, version }, path: packagePath } = await readPkgUp({
1414
normalize: false,
15-
cwd: path.dirname(filePath)
15+
cwd: path.dirname(filePath),
1616
});
1717
const file = filePath.replace(path.dirname(packagePath), name);
1818

1919
const id = hasher(`${name}|${version}|${file}`);
2020
return { id, name, version, file };
2121
};
2222

23-
module.exports.bundleCssModule = async function bundleCssModule(filePath) {
23+
module.exports.bundleCssModule = async function bundleCssModule (filePath) {
2424
const fileContents = await readFile(filePath, 'utf8');
2525
const { css } = await postcss()
2626
.use(atImport())

lib/writer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { isAbsolute } = require('path');
77
const assert = require('assert');
88

99
module.exports = class Writer extends Readable {
10-
constructor(files = []) {
10+
constructor (files = []) {
1111
super({ objectMode: true });
1212

1313
assert(
@@ -22,7 +22,7 @@ module.exports = class Writer extends Readable {
2222
}
2323
}
2424

25-
async _read() {
25+
async _read () {
2626
const file = this.files.shift();
2727
if (!file) {
2828
this.push(null);

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"devDependencies": {
3535
"eslint": "^4.1.1",
36-
"eslint-config-finn": "^2.0.0",
36+
"eslint-config-finn": "^3.0.0",
3737
"jest": "^21.2.1",
3838
"prettier": "^1.7.4"
3939
},

test/writer.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
/* global test, expect */
4+
35
const path = require('path');
46
const { hasher } = require('asset-pipe-common');
57
const { identifyCssModule, bundleCssModule } = require('../lib/util.js');
@@ -15,7 +17,7 @@ test('identifyCssModule(filePath)', async () => {
1517
id: hasher(`my-module-1|1.0.1|${fileRef}`),
1618
name: 'my-module-1',
1719
version: '1.0.1',
18-
file: fileRef
20+
file: fileRef,
1921
};
2022
expect(result).toEqual(identifier);
2123
});
@@ -30,7 +32,7 @@ test('identifyCssModule(filePath) css in nested directory', async () => {
3032
id: hasher(`my-module-2|1.0.1|${fileRef}`),
3133
name: 'my-module-2',
3234
version: '1.0.1',
33-
file: fileRef
35+
file: fileRef,
3436
};
3537
expect(result).toEqual(identifier);
3638
});

0 commit comments

Comments
 (0)