Widen reach of linting scripts and fix linting errors (#1970)

* Format various files

* Wider reaching lint/format

The autoformat tools should format the same files you should run into in
your editor. Previously we weren't catching js files, json files and any
ts files outside the src folder.

Update lint:js command to include the whole folder, not just src
Update format:prettier command to include json files.

Fix linting issues raised by checking more files.
This commit is contained in:
Kaelig Deloumeau-Prigent
2018-08-23 17:22:27 -07:00
committed by GitHub
parent edd424216e
commit a57d64b733
33 changed files with 282 additions and 239 deletions

View File

@@ -1,3 +1,5 @@
/* eslint-disable no-console */
import {cp, mkdir, rm} from 'shelljs';
import {resolve} from 'path';

View File

@@ -1,3 +1,5 @@
/* eslint-disable no-console */
require('isomorphic-fetch');
const {resolve} = require('path');

View File

@@ -25,7 +25,10 @@ function optimizeFile(file) {
svgo.optimize(data, (result) => {
removeSync(file);
const newFile = resolvePath(dirname(file), `${paramCase(basename(file, '.svg'))}.svg`);
const newFile = resolvePath(
dirname(file),
`${paramCase(basename(file, '.svg'))}.svg`,
);
writeFileSync(newFile, `${result.data}\n`);
resolve();
});

View File

@@ -1,7 +1,4 @@
{
"extends": "../tsconfig.json",
"exclude": [
"../src/**/*.test.ts",
"../src/**/*.test.tsx"
]
"exclude": ["../src/**/*.test.ts", "../src/**/*.test.tsx"]
}