Skip to content
This repository was archived by the owner on Oct 30, 2020. It is now read-only.

Commit eca0946

Browse files
authored
Merge pull request #16 from Jimdo/fixup-eslint
remove eslint issues
2 parents 1ddc271 + 3c99752 commit eca0946

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/cssModuleToInterface.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ const allWordsRegexp = /^\w+$/i;
2222
export const filterNonWordClasses = (cssModuleKeys) => {
2323
const filteredClassNames = cssModuleKeys.filter(classname => allWordsRegexp.test(classname));
2424
if (filteredClassNames.length === cssModuleKeys.length) {
25-
return [filteredClassNames, []];
25+
return [filteredClassNames, [],];
2626
}
2727
const nonWordClassNames = cssModuleKeys.filter(classname => !allWordsRegexp.test(classname));
28-
return [filteredClassNames, nonWordClassNames];
29-
}
28+
return [filteredClassNames, nonWordClassNames,];
29+
};
3030

3131
export const filenameToTypingsFilename = (filename) => {
3232
const dirName = path.dirname(filename);

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = function(input) {
4343
if (!query.namedExport) {
4444
cssModuleDefinition = generateGenericExportInterface(cssModuleKeys, filename);
4545
} else {
46-
const [cleanedDefinitions, skippedDefinitions] = filterNonWordClasses(cssModuleKeys);
46+
const [cleanedDefinitions, skippedDefinitions,] = filterNonWordClasses(cssModuleKeys);
4747
if (skippedDefinitions.length > 0 && !query.camelCase) {
4848
console.warn(`Typings for CSS-Modules: option 'namedExport' was set but 'camelCase' for the css-loader not.
4949
The following classes will not be available as named exports:
@@ -57,4 +57,4 @@ ${skippedDefinitions.map(sd => ` - "${sd}"`).join('\n').red}
5757
delegateToCssLoader(this, input, callback);
5858
};
5959
cssLocalsLoader.call(this, input);
60-
}
60+
};

src/persist.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ import crypto from 'crypto';
44
export const writeToFileIfChanged = (filename, content) => {
55
try {
66
const currentInput = fs.readFileSync(filename, 'utf-8');
7-
const oldHash = crypto.createHash('md5').update(currentInput).digest("hex");
8-
const newHash = crypto.createHash('md5').update(content).digest("hex");
7+
const oldHash = crypto.createHash('md5').update(currentInput).digest('hex');
8+
const newHash = crypto.createHash('md5').update(content).digest('hex');
99
// the definitions haven't changed - ignore this
1010
if (oldHash === newHash) {
1111
return false;
1212
}
13-
} catch(e) {
1413
} finally {
1514
fs.writeFileSync(filename, content);
1615
}

0 commit comments

Comments
 (0)