Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pushkine committed May 27, 2020
1 parent 00bb5d1 commit d7708c5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion test/.eslintrc.json
@@ -1,5 +1,6 @@
{
"rules": {
"no-console": "off"
"no-console": "off",
"@typescript-eslint/no-var-requires": "off"
}
}
8 changes: 5 additions & 3 deletions test/js/update.ts
@@ -1,14 +1,16 @@
import { readFileSync, writeFileSync } from 'fs';
import { resolve } from 'path';
import { glob } from '../tiny-glob';
// this file will replace all the expected.js files with their _actual
// equivalents. Only use it when you're sure that you haven't
// broken anything!

const svelte = (function loadSvelte(test) {
process.env.TEST = test ? 'true' : '';
const resolved = require.resolve('../../compiler.js');
delete require.cache[resolved];
return require(resolved);
})(false);

function loadConfig(file) {
try {
const resolved = require.resolve(file);
Expand All @@ -24,8 +26,8 @@ function loadConfig(file) {
throw err;
}
}
require(resolve(__dirname, '../tiny-glob.ts'))
.glob('samples/*/input.svelte', { cwd: __dirname })

glob('samples/*/input.svelte', { cwd: __dirname })
.forEach((file) => {
writeFileSync(
`${__dirname}/${file.replace('input.svelte', 'expected.js')}`,
Expand Down
7 changes: 4 additions & 3 deletions test/parser/update.ts
@@ -1,5 +1,6 @@
import { readFileSync, writeFileSync } from 'fs';
import { resolve } from 'path';
import { glob } from '../tiny-glob';

// this file will replace all the expected.js files with their _actual
// equivalents. Only use it when you're sure that you haven't
// broken anything!
Expand All @@ -9,8 +10,8 @@ const svelte = (function loadSvelte(test) {
delete require.cache[resolved];
return require(resolved);
})(false);
require(resolve(__dirname, '../tiny-glob.ts'))
.glob('samples/*/input.svelte', { cwd: __dirname })

glob('samples/*/input.svelte', { cwd: __dirname })
.forEach((file) => {
try {
writeFileSync(
Expand Down

0 comments on commit d7708c5

Please sign in to comment.