From a92a5a55c653041f6001bdbc508696d4f6806a1a Mon Sep 17 00:00:00 2001 From: younggglcy Date: Tue, 4 Jun 2024 12:59:11 +0800 Subject: [PATCH] chore: formats --- packages/eslint/rollup.config.mjs | 4 ++-- packages/eslint/test/test.mjs | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/eslint/rollup.config.mjs b/packages/eslint/rollup.config.mjs index 84d567b5f..9c4885e64 100755 --- a/packages/eslint/rollup.config.mjs +++ b/packages/eslint/rollup.config.mjs @@ -1,12 +1,12 @@ import { readFileSync } from 'fs'; import { createConfig } from '../../shared/rollup.config.mjs'; -import esmShim from '@rollup/plugin-esm-shim' +import esmShim from '@rollup/plugin-esm-shim'; import typescript from '@rollup/plugin-typescript'; export default { ...createConfig({ pkg: JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')) }), - plugins: [esmShim(), typescript({ sourceMap: true })], + plugins: [esmShim(), typescript({ sourceMap: true })] }; diff --git a/packages/eslint/test/test.mjs b/packages/eslint/test/test.mjs index 815c16885..efa87166a 100755 --- a/packages/eslint/test/test.mjs +++ b/packages/eslint/test/test.mjs @@ -14,7 +14,7 @@ const fixtures = resolve(fileURLToPath(new URL('.', import.meta.url)), 'fixtures test.before(() => { process.chdir(fixtures); -}) +}); test('should lint files', async (t) => { let count = 0; @@ -23,7 +23,7 @@ test('should lint files', async (t) => { plugins: [ eslint({ formatter: (results) => { - const {messages} = results[0]; + const { messages } = results[0]; count += messages.length; t.is(messages[0].message, "'use strict' is unnecessary inside of modules."); t.is(messages[1].message, "'x' is not defined."); @@ -188,10 +188,7 @@ test('should not fail with asynchronous formatter function', async (t) => { }); test('should fix source code', async (t) => { - fs.writeFileSync( - 'fixable-clone.js', - fs.readFileSync('fixable.js') - ); + fs.writeFileSync('fixable-clone.js', fs.readFileSync('fixable.js')); await rollup({ input: 'fixable-clone.js', @@ -219,7 +216,7 @@ test('works with cjs plugin', async (t) => { plugins: [ eslintPluginCjs({ formatter: (results) => { - const {messages} = results[0]; + const { messages } = results[0]; count += messages.length; t.is(messages[0].message, "'use strict' is unnecessary inside of modules."); t.is(messages[1].message, "'x' is not defined.");