mirror of
https://github.com/immich-app/immich.git
synced 2024-11-15 09:59:00 -07:00
5e6ac87eaf
chore: object shorthand
66 lines
1.8 KiB
JavaScript
66 lines
1.8 KiB
JavaScript
import { FlatCompat } from '@eslint/eslintrc';
|
|
import js from '@eslint/js';
|
|
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
import tsParser from '@typescript-eslint/parser';
|
|
import globals from 'globals';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
const compat = new FlatCompat({
|
|
baseDirectory: __dirname,
|
|
recommendedConfig: js.configs.recommended,
|
|
allConfig: js.configs.all,
|
|
});
|
|
|
|
export default [
|
|
{
|
|
ignores: ['eslint.config.mjs'],
|
|
},
|
|
...compat.extends(
|
|
'plugin:@typescript-eslint/recommended',
|
|
'plugin:prettier/recommended',
|
|
'plugin:unicorn/recommended',
|
|
),
|
|
{
|
|
plugins: {
|
|
'@typescript-eslint': typescriptEslint,
|
|
},
|
|
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node,
|
|
},
|
|
|
|
parser: tsParser,
|
|
ecmaVersion: 5,
|
|
sourceType: 'module',
|
|
|
|
parserOptions: {
|
|
project: 'tsconfig.json',
|
|
tsconfigRootDir: __dirname,
|
|
},
|
|
},
|
|
|
|
rules: {
|
|
'@typescript-eslint/interface-name-prefix': 'off',
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/no-floating-promises': 'error',
|
|
'unicorn/prefer-module': 'off',
|
|
'unicorn/import-style': 'off',
|
|
curly: 2,
|
|
'prettier/prettier': 0,
|
|
'unicorn/prevent-abbreviations': 'off',
|
|
'unicorn/filename-case': 'off',
|
|
'unicorn/no-null': 'off',
|
|
'unicorn/prefer-top-level-await': 'off',
|
|
'unicorn/prefer-event-target': 'off',
|
|
'unicorn/no-thenable': 'off',
|
|
'object-shorthand': ['error', 'always'],
|
|
},
|
|
},
|
|
];
|