mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 06:00:56 +02:00

* ci(backend-review.yml): add linter step to the backend review workflow * chore(backend-review.yml): remove prettier from lint-action configuration * chore: apply new linting workflow * chore(lint-staged.config.js): reorder lint-staged tasks for JavaScript and TypeScript files * chore(eslint): update ignorePatterns in .eslintrc.js chore(lint-action): remove prettier option in backend-review.yml chore(package.json): add lint and lint:fix scripts * chore(lint-staged.config.js): remove prettier --write command for js, jsx, ts, tsx files * chore(titleConvo.js): remove unnecessary console.log statement chore(titleConvo.js): add missing comma in options object * chore: apply linting to all files * chore(lint-staged.config.js): update lint-staged configuration to include prettier formatting
90 lines
2.3 KiB
JavaScript
90 lines
2.3 KiB
JavaScript
module.exports = {
|
|
env: {
|
|
browser: true,
|
|
es2021: true,
|
|
node: true,
|
|
commonjs: true,
|
|
es6: true,
|
|
},
|
|
extends: ['prettier'],
|
|
parser: '@typescript-eslint/parser',
|
|
parserOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
},
|
|
},
|
|
plugins: ['react', 'react-hooks', '@typescript-eslint'],
|
|
rules: {
|
|
'react/react-in-jsx-scope': 'off',
|
|
indent: ['error', 2, { SwitchCase: 1 }],
|
|
'max-len': [
|
|
'error',
|
|
{
|
|
code: 150,
|
|
ignoreStrings: true,
|
|
ignoreTemplateLiterals: true,
|
|
ignoreComments: true,
|
|
},
|
|
],
|
|
'linebreak-style': 0,
|
|
// 'arrow-parens': [2, 'as-needed', { requireForBlockBody: true }],
|
|
// 'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
|
'no-console': 'off',
|
|
'import/extensions': 'off',
|
|
'no-promise-executor-return': 'off',
|
|
'no-param-reassign': 'off',
|
|
'no-continue': 'off',
|
|
'no-restricted-syntax': 'off',
|
|
'react/prop-types': ['off'],
|
|
'react/display-name': ['off'],
|
|
},
|
|
overrides: [
|
|
{
|
|
files: ['**/*.ts', '**/*.tsx, **/*.js, **/*.jsx'],
|
|
rules: {
|
|
'no-unused-vars': 'off', // off because it conflicts with '@typescript-eslint/no-unused-vars'
|
|
'react/display-name': 'off',
|
|
'@typescript-eslint/no-unused-vars': 'warn',
|
|
},
|
|
},
|
|
{
|
|
files: ['rollup.config.js', '.eslintrc.js', 'jest.config.js'],
|
|
env: {
|
|
node: true,
|
|
},
|
|
},
|
|
{
|
|
files: [
|
|
'**/*.test.js',
|
|
'**/*.test.jsx',
|
|
'**/*.test.ts',
|
|
'**/*.test.tsx',
|
|
'**/*.spec.js',
|
|
'**/*.spec.jsx',
|
|
'**/*.spec.ts',
|
|
'**/*.spec.tsx',
|
|
'setupTests.js',
|
|
],
|
|
env: {
|
|
jest: true,
|
|
node: true,
|
|
},
|
|
rules: {
|
|
'react/display-name': 'off',
|
|
'react/prop-types': 'off',
|
|
'react/no-unescaped-entities': 'off',
|
|
},
|
|
},
|
|
],
|
|
settings: {
|
|
react: {
|
|
createClass: 'createReactClass', // Regex for Component Factory to use,
|
|
// default to "createReactClass"
|
|
pragma: 'React', // Pragma to use, default to "React"
|
|
fragment: 'Fragment', // Fragment to use (may be a property of <pragma>), default to "Fragment"
|
|
version: 'detect', // React version. "detect" automatically picks the version you have installed.
|
|
},
|
|
},
|
|
};
|