0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

[ci] format

This commit is contained in:
Jason 2024-04-15 08:06:20 +00:00 committed by astrobot-houston
parent 6ebd81dbc4
commit a4e7d6650d

View file

@ -1,14 +1,14 @@
import path from 'node:path'; import path from 'node:path';
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from 'node:url';
import {builtinModules} from "node:module"; import { builtinModules } from 'node:module';
import {FlatCompat} from "@eslint/eslintrc"; import { FlatCompat } from '@eslint/eslintrc';
import tseslint from 'typescript-eslint'; import tseslint from 'typescript-eslint';
// plugins // plugins
import prettierEslint from 'eslint-plugin-prettier'; import prettierEslint from 'eslint-plugin-prettier';
import noOnlyTestsEslint from 'eslint-plugin-no-only-tests'; import noOnlyTestsEslint from 'eslint-plugin-no-only-tests';
import regexpEslint from 'eslint-plugin-regexp' import regexpEslint from 'eslint-plugin-regexp';
const typescriptEslint = tseslint.plugin; const typescriptEslint = tseslint.plugin;
// parsers // parsers
@ -20,7 +20,7 @@ const __dirname = path.dirname(__filename);
// ref: https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config // ref: https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
// mimic CommonJS variables -- not needed if using CommonJS // mimic CommonJS variables -- not needed if using CommonJS
const compat = new FlatCompat({ const compat = new FlatCompat({
baseDirectory: __dirname baseDirectory: __dirname,
}); });
export default [ export default [
@ -28,18 +28,18 @@ export default [
// ref: https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores // ref: https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores
{ {
ignores: [ ignores: [
"**/.*", '**/.*',
"**/*.d.ts", '**/*.d.ts',
"packages/**/*.min.js", 'packages/**/*.min.js',
"packages/**/dist/", 'packages/**/dist/',
"packages/**/fixtures/", 'packages/**/fixtures/',
"packages/astro/vendor/vite/", 'packages/astro/vendor/vite/',
"benchmark/**/dist/", 'benchmark/**/dist/',
"examples/", 'examples/',
"scripts/", 'scripts/',
".github/", '.github/',
".changeset/", '.changeset/',
] ],
}, },
...tseslint.configs.recommendedTypeChecked, ...tseslint.configs.recommendedTypeChecked,
@ -56,10 +56,10 @@ export default [
}, },
}, },
plugins: { plugins: {
"@typescript-eslint": typescriptEslint, '@typescript-eslint': typescriptEslint,
"prettier": prettierEslint, prettier: prettierEslint,
"no-only-tests": noOnlyTestsEslint, 'no-only-tests': noOnlyTestsEslint,
"regexp": regexpEslint, regexp: regexpEslint,
}, },
rules: { rules: {
// These off/configured-differently-by-default rules fit well for us // These off/configured-differently-by-default rules fit well for us
@ -143,7 +143,7 @@ export default [
languageOptions: { languageOptions: {
globals: { globals: {
browser: true, browser: true,
} },
}, },
}, },
{ {
@ -152,7 +152,7 @@ export default [
globals: { globals: {
mocha: true, mocha: true,
globalThis: false, // false means read-only globalThis: false, // false means read-only
} },
}, },
rules: { rules: {
'no-console': 'off', 'no-console': 'off',
@ -203,4 +203,4 @@ export default [
], ],
}, },
}, },
] ];