Skip to content

Commit

Permalink
🛠️ [Eslint] Tweaks for root config
Browse files Browse the repository at this point in the history
  • Loading branch information
beefchimi committed Jul 31, 2024
1 parent 1ef08e6 commit cd9e355
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 108 deletions.
79 changes: 38 additions & 41 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,50 +1,47 @@
// eslint.config.js
import antfu from '@antfu/eslint-config';

// References:
// 1. https://github.com/antfu/eslint-config
// 2. https://github.com/antfu/eslint-plugin-antfu
// 3. https://github.com/antfu/eslint-plugin-format
export default antfu({
// The default is 'app', but we might want to
// use `lib` here and `app` within `/website`.
// type: 'lib',

// In case we want to use a custom config within `website`: 'app/**'
ignores: ['.nx/cache', 'coverage/**', 'dist/**', 'scrap/**', 'app/**'],

formatters: {
// Formats .css and .scss files, but also the `<style>` blocks in Vue.
css: true,
markdown: true,
},

stylistic: {
semi: true,
export default antfu(
// Library config
{
type: 'lib',
// Antfu respects `gitignore`, so we don't need to repeat those directories.
ignores: ['app/**'],
formatters: {
markdown: true,
},
stylistic: {
semi: true,
},
typescript: {
tsconfigPath: 'tsconfig.json',
},
vue: false,
},
// General config
{
// Without a `files` scope, these rules will apply to everything.
rules: {
'antfu/if-newline': 'off',
'no-console': 'warn',
'style/arrow-parens': ['error', 'always'],
'style/object-curly-spacing': ['error', 'never'],
'test/prefer-lowercase-title': 'off',
'ts/explicit-function-return-type': 'off',
'ts/strict-boolean-expressions': 'off',
// Would like this if I could differentiate between ternary and if conditions.
// 'style/operator-linebreak': ['error', 'after'],

typescript: {
tsconfigPath: 'tsconfig.json',
// overrides: {},
},

// vue: {overrides: {}},
}, {
// Without a `files` scope, these rules will apply to everything.
rules: {
'antfu/if-newline': 'off',
'no-console': 'warn',
'style/arrow-parens': ['error', 'always'],
'style/object-curly-spacing': ['error', 'never'],
'test/prefer-lowercase-title': 'off',
'ts/strict-boolean-expressions': 'off',

// TODO: Try and solve broken if/else statements.
/*
'style/padding-line-between-statements': [
'error',
{blankLine: 'never', prev: 'if', next: 'block-like'},
],
*/
// TODO: Try and solve broken if/else statements.
/*
'style/padding-line-between-statements': [
'error',
{blankLine: 'never', prev: 'if', next: 'block-like'},
],
*/
},
},
});
);
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"nuke": "pnpm clean && ./scripts/nuke.sh",
"start": "pnpm --filter earwurm build && pnpm -r --parallel --stream start",
"build": "pnpm -r build",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"lint": "pnpm -r lint && eslint .",
"lint:fix": "pnpm -r lint:fix && eslint . --fix",
"format": "echo 'Formatting is handled by eslint.'",
"type-check": "pnpm build && pnpm -r type-check",
"test": "vitest --pool forks",
Expand Down
Loading

0 comments on commit cd9e355

Please sign in to comment.