mirror of
https://github.com/Lifeforge-app/lifeforge.git
synced 2026-06-28 06:46:24 +00:00
feat: readded ESLint configuration file that has been accidentally ignored by git
Former-commit-id: 0d7774055da7b10c7a3ed8da8444e75c2168da87 [formerly f2c040013df26f04fdde14d0bdd162cd25b49feb] [formerly a8031812eee194e3a150537de81437fe2dc4b710 [formerly 75c3a63640a828e8e78bd957273fbefccf1965e1]] Former-commit-id: b2c3bfc5baac5e0cf76126faf2b544a2510a2cbc [formerly abcad55cdd21843ddadbe0e0070e73f394ba0f12] Former-commit-id: c5b4d3240231db2c6222e9bde18eb358ec1beec7
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,6 +11,7 @@ dist
|
||||
build
|
||||
tsbuild
|
||||
*.js
|
||||
!eslint.config.js
|
||||
*.tsbuildinfo
|
||||
|
||||
# misc
|
||||
|
||||
124
eslint.config.js
Normal file
124
eslint.config.js
Normal file
@@ -0,0 +1,124 @@
|
||||
import js from '@eslint/js'
|
||||
import jsxA11y from 'eslint-plugin-jsx-a11y'
|
||||
import pluginReact from 'eslint-plugin-react'
|
||||
import reactCompiler from 'eslint-plugin-react-compiler'
|
||||
import sonarjs from 'eslint-plugin-sonarjs'
|
||||
import unusedImports from 'eslint-plugin-unused-imports'
|
||||
import globals from 'globals'
|
||||
import process from 'node:process'
|
||||
import tseslint from 'typescript-eslint'
|
||||
|
||||
export default [
|
||||
{
|
||||
ignores: ['**/*.config.js', '**/dist/', 'dist/']
|
||||
},
|
||||
{
|
||||
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.browser
|
||||
},
|
||||
sourceType: 'module',
|
||||
parserOptions: {
|
||||
project: './tsconfig.eslint.json',
|
||||
tsconfigRootDir: process.cwd(),
|
||||
sourceType: 'module'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// JS/TS Presets
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
|
||||
// React & JSX Presets
|
||||
pluginReact.configs.flat.recommended,
|
||||
{
|
||||
plugins: {
|
||||
'react-compiler': reactCompiler,
|
||||
react: pluginReact
|
||||
},
|
||||
rules: {
|
||||
'react-compiler/react-compiler': 'error',
|
||||
'react/react-in-jsx-scope': 'off',
|
||||
'react/jsx-sort-props': [
|
||||
'error',
|
||||
{
|
||||
callbacksLast: true,
|
||||
shorthandFirst: true,
|
||||
shorthandLast: false,
|
||||
ignoreCase: true,
|
||||
noSortAlphabetically: false,
|
||||
reservedFirst: true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// JSX Accessibility Presets
|
||||
{
|
||||
files: ['**/*.{js,jsx,ts,tsx,mjs,cjs}'],
|
||||
...jsxA11y.flatConfigs.recommended,
|
||||
rules: {
|
||||
'jsx-a11y/no-autofocus': 'off'
|
||||
}
|
||||
},
|
||||
|
||||
// SonarJS
|
||||
{
|
||||
...sonarjs.configs.recommended,
|
||||
rules: {
|
||||
'sonarjs/prefer-read-only-props': 'off'
|
||||
}
|
||||
},
|
||||
|
||||
// Unused Imports
|
||||
{
|
||||
plugins: {
|
||||
'unused-imports': unusedImports
|
||||
},
|
||||
rules: {
|
||||
'no-unused-vars': 'off',
|
||||
'unused-imports/no-unused-imports': 'error',
|
||||
'unused-imports/no-unused-vars': [
|
||||
'warn',
|
||||
{
|
||||
vars: 'all',
|
||||
varsIgnorePattern: '^_',
|
||||
args: 'after-used',
|
||||
argsIgnorePattern: '^_'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// Code Style and Formatting
|
||||
{
|
||||
rules: {
|
||||
'padding-line-between-statements': [
|
||||
'error',
|
||||
{ blankLine: 'always', prev: 'import', next: '*' },
|
||||
{ blankLine: 'any', prev: 'import', next: 'import' },
|
||||
{ blankLine: 'always', prev: '*', next: 'const' },
|
||||
{ blankLine: 'always', prev: 'const', next: '*' },
|
||||
{ blankLine: 'always', prev: '*', next: 'function' },
|
||||
{ blankLine: 'always', prev: '*', next: 'class' },
|
||||
{ blankLine: 'always', prev: '*', next: 'export' },
|
||||
{ blankLine: 'always', prev: 'export', next: '*' },
|
||||
{ blankLine: 'always', prev: '*', next: 'block-like' },
|
||||
{ blankLine: 'always', prev: '*', next: 'return' }
|
||||
],
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
vars: 'all',
|
||||
args: 'after-used',
|
||||
ignoreRestSiblings: true,
|
||||
varsIgnorePattern: '^_',
|
||||
argsIgnorePattern: '^_'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user