Skip to content

Commit eae9138

Browse files
authored
Switch to ESM (#2028)
2 parents 78e791e + 4ce75dd commit eae9138

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+7263
-11264
lines changed

.babelrc

-20
This file was deleted.

.env.test

-2
This file was deleted.

.eslintrc.json

-177
This file was deleted.

.github/workflows/deploy-production-push.yml

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
filters: |
1414
web:
1515
- 'src/**'
16-
- '.babelrc'
1716
- 'astro.config.mjs'
1817
- 'netlify.toml'
1918
- 'package-lock.json'

.github/workflows/test.yml

-29
This file was deleted.

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@
3636
"**/CONTRIBUTING.md": true,
3737
"**/LICENSE": true,
3838
"**/README.md": true,
39-
}
39+
},
40+
"eslint.experimental.useFlatConfig": true
4041
}

astro.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig } from 'astro/config';
2-
import settings from './src/settings/global.json';
2+
import settings from '#settings/global';
33

44
// https://astro.build/config
55
export default defineConfig({

eslint.config.js

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
import js from '@eslint/js';
2+
import eslintConfigPrettier from 'eslint-config-prettier';
3+
import globals from './globals.js';
4+
5+
export default [
6+
js.configs.recommended,
7+
eslintConfigPrettier,
8+
{
9+
languageOptions: {
10+
ecmaVersion: 2023,
11+
sourceType: 'module',
12+
globals: {
13+
...globals,
14+
},
15+
},
16+
rules: {
17+
indent: 'off',
18+
'comma-dangle': [
19+
'error',
20+
{
21+
arrays: 'always-multiline',
22+
objects: 'always-multiline',
23+
imports: 'always-multiline',
24+
exports: 'only-multiline',
25+
functions: 'never',
26+
},
27+
],
28+
quotes: [
29+
'error',
30+
'single',
31+
{
32+
avoidEscape: true,
33+
allowTemplateLiterals: true,
34+
},
35+
],
36+
semi: ['error', 'always'],
37+
'semi-spacing': [
38+
'error',
39+
{
40+
before: false,
41+
after: false,
42+
},
43+
],
44+
'no-trailing-spaces': 'error',
45+
'no-duplicate-imports': 'error',
46+
'no-useless-computed-key': 'error',
47+
'rest-spread-spacing': ['error', 'never'],
48+
'no-console': 'off',
49+
eqeqeq: ['error', 'smart'],
50+
'brace-style': [
51+
'error',
52+
'1tbs',
53+
{
54+
allowSingleLine: true,
55+
},
56+
],
57+
curly: 'off',
58+
'object-shorthand': ['warn', 'always'],
59+
'key-spacing': [
60+
'error',
61+
{
62+
beforeColon: false,
63+
afterColon: true,
64+
mode: 'strict',
65+
},
66+
],
67+
camelcase: [
68+
'warn',
69+
{
70+
properties: 'always',
71+
},
72+
],
73+
'dot-location': ['error', 'property'],
74+
'generator-star-spacing': ['off'],
75+
'block-spacing': ['error', 'always'],
76+
'comma-style': ['error', 'last'],
77+
'comma-spacing': [
78+
'error',
79+
{
80+
before: false,
81+
after: true,
82+
},
83+
],
84+
'no-extend-native': 'error',
85+
'no-loop-func': 'error',
86+
'no-implied-eval': 'error',
87+
'no-iterator': 'error',
88+
'no-label-var': 'error',
89+
'no-multi-str': 'error',
90+
'no-script-url': 'error',
91+
'no-shadow-restricted-names': 'error',
92+
'no-spaced-func': 'error',
93+
'no-sparse-arrays': 'warn',
94+
'no-fallthrough': 'warn',
95+
'no-caller': 'error',
96+
'no-eval': 'error',
97+
'no-multiple-empty-lines': [
98+
'error',
99+
{
100+
max: 2,
101+
maxEOF: 1,
102+
},
103+
],
104+
'no-multi-spaces': [
105+
'error',
106+
{
107+
ignoreEOLComments: true,
108+
},
109+
],
110+
'no-negated-in-lhs': 'error',
111+
'no-new': 'error',
112+
'no-new-require': 'error',
113+
'block-scoped-var': 'error',
114+
'no-use-before-define': 'warn',
115+
'no-proto': 'error',
116+
complexity: ['warn', 50],
117+
'wrap-iife': ['error', 'outside'],
118+
'new-parens': 'error',
119+
'space-infix-ops': 'error',
120+
'eol-last': ['error', 'always'],
121+
'space-unary-ops': 'error',
122+
'arrow-parens': ['error', 'as-needed'],
123+
'arrow-spacing': 'error',
124+
'space-before-blocks': ['error', 'always'],
125+
yoda: ['error', 'never'],
126+
'space-before-function-paren': 'off',
127+
'spaced-comment': ['error', 'always'],
128+
},
129+
},
130+
];

0 commit comments

Comments
 (0)