Skip to content

Commit

Permalink
chore: formats
Browse files Browse the repository at this point in the history
  • Loading branch information
younggglcy committed Jun 4, 2024
1 parent b191e19 commit 92d6003
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/eslint/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { readFileSync } from 'fs';

import { createConfig } from '../../shared/rollup.config.mjs';

Check warning on line 3 in packages/eslint/rollup.config.mjs

View workflow job for this annotation

GitHub Actions / Node v20

There should be at least one empty line between import groups

Check warning on line 3 in packages/eslint/rollup.config.mjs

View workflow job for this annotation

GitHub Actions / Node v20

`../../shared/rollup.config.mjs` import should occur after import of `@rollup/plugin-typescript`

Check warning on line 3 in packages/eslint/rollup.config.mjs

View workflow job for this annotation

GitHub Actions / Node v18

There should be at least one empty line between import groups

Check warning on line 3 in packages/eslint/rollup.config.mjs

View workflow job for this annotation

GitHub Actions / Node v18

`../../shared/rollup.config.mjs` import should occur after import of `@rollup/plugin-typescript`
import esmShim from '@rollup/plugin-esm-shim'
import esmShim from '@rollup/plugin-esm-shim';

Check failure on line 4 in packages/eslint/rollup.config.mjs

View workflow job for this annotation

GitHub Actions / Node v20

Absolute imports should come before relative imports

Check failure on line 4 in packages/eslint/rollup.config.mjs

View workflow job for this annotation

GitHub Actions / Node v18

Absolute imports should come before relative imports
import typescript from '@rollup/plugin-typescript';

Check failure on line 5 in packages/eslint/rollup.config.mjs

View workflow job for this annotation

GitHub Actions / Node v20

Absolute imports should come before relative imports

Check failure on line 5 in packages/eslint/rollup.config.mjs

View workflow job for this annotation

GitHub Actions / Node v18

Absolute imports should come before relative imports

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 })]
};
11 changes: 4 additions & 7 deletions packages/eslint/test/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -23,7 +23,7 @@ test('should lint files', async (t) => {
plugins: [
eslint({
formatter: (results) => {
const {messages} = results[0];
const { messages } = results[0];

Check warning on line 26 in packages/eslint/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v20

Use array destructuring

Check warning on line 26 in packages/eslint/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v18

Use array destructuring
count += messages.length;
t.is(messages[0].message, "'use strict' is unnecessary inside of modules.");
t.is(messages[1].message, "'x' is not defined.");
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -219,7 +216,7 @@ test('works with cjs plugin', async (t) => {
plugins: [
eslintPluginCjs({
formatter: (results) => {
const {messages} = results[0];
const { messages } = results[0];

Check warning on line 219 in packages/eslint/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v20

Use array destructuring

Check warning on line 219 in packages/eslint/test/test.mjs

View workflow job for this annotation

GitHub Actions / Node v18

Use array destructuring
count += messages.length;
t.is(messages[0].message, "'use strict' is unnecessary inside of modules.");
t.is(messages[1].message, "'x' is not defined.");
Expand Down

0 comments on commit 92d6003

Please sign in to comment.