Skip to content

Commit

Permalink
build: 🚧add eslint config files
Browse files Browse the repository at this point in the history
This will help other developers to get all the necessary tools for formatting with VSC.
  • Loading branch information
Krutoy242 committed Dec 26, 2023
1 parent f5aacd2 commit bd7dd29
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ structures/inactive
!.github/
!.imgbotconfig

# Developing-only configs
!.eslint.config.js
!.tsconfig.json
!.vscode/settings.json

# OTG configs
!mods
mods/*
Expand Down
69 changes: 69 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import antfu from '@antfu/eslint-config'

export default antfu({
// typescript: { tsconfigPath: 'tsconfig.json' },
gitignore: false,
rules : {

// Override @antfu rules to my personal prefferences
'style/key-spacing' : ['error', { align: 'colon' }],
'antfu/if-newline' : 'off',
'style/comma-dangle': [
'error',
{
functions: 'never',
imports : 'always-multiline',
exports : 'always-multiline',
arrays : 'always-multiline',
objects : 'always-multiline',
},
],

// Lower error levels
'style/max-statements-per-line': 'warn',

// Sort imports
'import/order': 'off',
'sort-imports': 'off',

'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars' : 'error',

'perfectionist/sort-array-includes' : 'error',
'perfectionist/sort-astro-attributes': 'error',
// 'perfectionist/sort-classes' : 'error',
'perfectionist/sort-enums' : 'error',
'perfectionist/sort-exports' : 'error',
'perfectionist/sort-imports' : ['error', {
type : 'natural',
groups: [
'side-effect',
'side-effect-style',
'type',
'builtin',
'external',
'internal-type',
'internal',
['parent-type', 'sibling-type', 'index-type'],
['parent', 'sibling', 'index'],
'object',
'unknown',
],
}],
'perfectionist/sort-interfaces' : 'error',
'perfectionist/sort-jsx-props' : 'error',
'perfectionist/sort-maps' : 'error',
'perfectionist/sort-named-exports' : 'error',
'perfectionist/sort-named-imports' : 'error',
'perfectionist/sort-object-types' : 'error',
// 'perfectionist/sort-objects': 'error',
'perfectionist/sort-svelte-attributes': 'error',
'perfectionist/sort-union-types' : 'error',
'perfectionist/sort-vue-attributes' : 'error',
},
}, {
files: ['**/*.md'],
rules: {
'style/no-trailing-spaces': 'off',
},
})
11 changes: 11 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "ESNext",
"experimentalDecorators": true,
"module": "ESNext",
"moduleResolution": "node",
"esModuleInterop": true
},
"include": ["**/*.js", "**/*.ts"],
"exclude": ["node_modules", "**/*.spec.ts", "**/*.test.ts"]
}

0 comments on commit bd7dd29

Please sign in to comment.