Skip to content

Commit

Permalink
Switch to ESM (#2028)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chalarangelo authored Oct 1, 2023
2 parents 78e791e + 4ce75dd commit eae9138
Show file tree
Hide file tree
Showing 87 changed files with 7,263 additions and 11,264 deletions.
20 changes: 0 additions & 20 deletions .babelrc

This file was deleted.

2 changes: 0 additions & 2 deletions .env.test

This file was deleted.

177 changes: 0 additions & 177 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/deploy-production-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
filters: |
web:
- 'src/**'
- '.babelrc'
- 'astro.config.mjs'
- 'netlify.toml'
- 'package-lock.json'
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/test.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@
"**/CONTRIBUTING.md": true,
"**/LICENSE": true,
"**/README.md": true,
}
},
"eslint.experimental.useFlatConfig": true
}
2 changes: 1 addition & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'astro/config';
import settings from './src/settings/global.json';
import settings from '#settings/global';

// https://astro.build/config
export default defineConfig({
Expand Down
130 changes: 130 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import globals from './globals.js';

export default [
js.configs.recommended,
eslintConfigPrettier,
{
languageOptions: {
ecmaVersion: 2023,
sourceType: 'module',
globals: {
...globals,
},
},
rules: {
indent: 'off',
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'only-multiline',
functions: 'never',
},
],
quotes: [
'error',
'single',
{
avoidEscape: true,
allowTemplateLiterals: true,
},
],
semi: ['error', 'always'],
'semi-spacing': [
'error',
{
before: false,
after: false,
},
],
'no-trailing-spaces': 'error',
'no-duplicate-imports': 'error',
'no-useless-computed-key': 'error',
'rest-spread-spacing': ['error', 'never'],
'no-console': 'off',
eqeqeq: ['error', 'smart'],
'brace-style': [
'error',
'1tbs',
{
allowSingleLine: true,
},
],
curly: 'off',
'object-shorthand': ['warn', 'always'],
'key-spacing': [
'error',
{
beforeColon: false,
afterColon: true,
mode: 'strict',
},
],
camelcase: [
'warn',
{
properties: 'always',
},
],
'dot-location': ['error', 'property'],
'generator-star-spacing': ['off'],
'block-spacing': ['error', 'always'],
'comma-style': ['error', 'last'],
'comma-spacing': [
'error',
{
before: false,
after: true,
},
],
'no-extend-native': 'error',
'no-loop-func': 'error',
'no-implied-eval': 'error',
'no-iterator': 'error',
'no-label-var': 'error',
'no-multi-str': 'error',
'no-script-url': 'error',
'no-shadow-restricted-names': 'error',
'no-spaced-func': 'error',
'no-sparse-arrays': 'warn',
'no-fallthrough': 'warn',
'no-caller': 'error',
'no-eval': 'error',
'no-multiple-empty-lines': [
'error',
{
max: 2,
maxEOF: 1,
},
],
'no-multi-spaces': [
'error',
{
ignoreEOLComments: true,
},
],
'no-negated-in-lhs': 'error',
'no-new': 'error',
'no-new-require': 'error',
'block-scoped-var': 'error',
'no-use-before-define': 'warn',
'no-proto': 'error',
complexity: ['warn', 50],
'wrap-iife': ['error', 'outside'],
'new-parens': 'error',
'space-infix-ops': 'error',
'eol-last': ['error', 'always'],
'space-unary-ops': 'error',
'arrow-parens': ['error', 'as-needed'],
'arrow-spacing': 'error',
'space-before-blocks': ['error', 'always'],
yoda: ['error', 'never'],
'space-before-function-paren': 'off',
'spaced-comment': ['error', 'always'],
},
},
];
Loading

0 comments on commit eae9138

Please sign in to comment.