Skip to content

Commit

Permalink
Remove charset (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Sep 18, 2021
1 parent 623f259 commit 3f37f75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/options-manager.js
Expand Up @@ -129,7 +129,7 @@ const mergeWithFileConfig = async options => {
options.ts = true;
const config = makeTSConfig(tsConfig, tsConfigPath, [options.filePath]);
await fs.mkdir(path.dirname(options.tsConfigPath), {recursive: true});
await fs.writeFile(options.tsConfigPath, JSON.stringify(config), 'utf8');
await fs.writeFile(options.tsConfigPath, JSON.stringify(config));
}

return {options, prettierOptions};
Expand Down
4 changes: 2 additions & 2 deletions test/options-manager.js
Expand Up @@ -557,7 +557,7 @@ test('mergeWithFileConfig: typescript files', async t => {
const expectedConfigPath = new RegExp(`${slash(cwd)}/node_modules/.cache/xo-linter/tsconfig\\..*\\.json[\\/]?$`, 'u');
t.regex(slash(options.tsConfigPath), expectedConfigPath);
t.deepEqual(omit(options, 'tsConfigPath'), expected);
t.deepEqual(JSON.parse(await fs.readFile(options.tsConfigPath, 'utf8')), {
t.deepEqual(JSON.parse(await fs.readFile(options.tsConfigPath)), {
extends: path.resolve(cwd, 'tsconfig.json'),
files: [path.resolve(cwd, 'file.ts')],
include: [slash(path.resolve(cwd, '**/*.ts')), slash(path.resolve(cwd, '**/*.tsx'))],
Expand All @@ -579,7 +579,7 @@ test('mergeWithFileConfig: tsx files', async t => {
const expectedConfigPath = new RegExp(`${slash(cwd)}/node_modules/.cache/xo-linter/tsconfig\\..*\\.json[\\/]?$`, 'u');
t.regex(slash(options.tsConfigPath), expectedConfigPath);
t.deepEqual(omit(options, 'tsConfigPath'), expected);
t.deepEqual(JSON.parse(await fs.readFile(options.tsConfigPath, 'utf8')), {
t.deepEqual(JSON.parse(await fs.readFile(options.tsConfigPath)), {
extends: path.resolve(cwd, 'tsconfig.json'),
files: [path.resolve(cwd, 'file.tsx')],
include: [slash(path.resolve(cwd, '**/*.ts')), slash(path.resolve(cwd, '**/*.tsx'))],
Expand Down

0 comments on commit 3f37f75

Please sign in to comment.