update config
This commit is contained in:
parent
9feef13d3a
commit
8e07336ec2
4 changed files with 58 additions and 39 deletions
|
@ -1 +0,0 @@
|
|||
public
|
|
@ -1,36 +0,0 @@
|
|||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
browser: true,
|
||||
node: true,
|
||||
es6: true,
|
||||
},
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser',
|
||||
ecmaVersion: 2020,
|
||||
sourceType: 'module',
|
||||
lib: ['es2020'],
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
tsx: true,
|
||||
},
|
||||
},
|
||||
plugins: ['prettier', 'jsdoc', 'security'],
|
||||
extends: [
|
||||
'prettier',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:prettier/recommended',
|
||||
'plugin:jsdoc/recommended',
|
||||
'plugin:security/recommended',
|
||||
],
|
||||
// add your custom rules here
|
||||
rules: {
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'warn',
|
||||
{ argsIgnorePattern: 'next|err|info|reject' },
|
||||
],
|
||||
},
|
||||
};
|
56
eslint.config.js
Normal file
56
eslint.config.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
// eslint.config.js
|
||||
import js from '@eslint/js';
|
||||
import eslintPluginPrettier from 'eslint-plugin-prettier';
|
||||
import tseslint from '@typescript-eslint/eslint-plugin';
|
||||
import security from 'eslint-plugin-security';
|
||||
import jsdoc from 'eslint-plugin-jsdoc';
|
||||
import globals from 'globals';
|
||||
|
||||
export default [
|
||||
{ ignores: ['public'] },
|
||||
js.configs.recommended,
|
||||
jsdoc.configs['flat/recommended'],
|
||||
{
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser',
|
||||
ecmaVersion: 2020,
|
||||
sourceType: 'module',
|
||||
lib: ['es2020'],
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
tsx: true,
|
||||
},
|
||||
},
|
||||
globals: {
|
||||
...globals.node, // Add Node.js globals
|
||||
...globals.browser, // Add browser globals
|
||||
...globals.es6, // Add ES6 globals (if not already included)
|
||||
// ...js.configs.recommended.languageOptions?.globals, // Remove if you want to completely rely on globals package
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
plugins: {
|
||||
prettier: eslintPluginPrettier,
|
||||
'@typescript-eslint': tseslint,
|
||||
jsdoc: jsdoc,
|
||||
security: security,
|
||||
},
|
||||
},
|
||||
{
|
||||
rules: {
|
||||
...tseslint.configs['recommended'].rules,
|
||||
...tseslint.configs['eslint-recommended'].rules,
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'warn',
|
||||
{ argsIgnorePattern: 'next|err|info|reject|^_' },
|
||||
],
|
||||
'prettier/prettier': 'error',
|
||||
'jsdoc/require-description': 'warn',
|
||||
'security/detect-object-injection': 'warn',
|
||||
},
|
||||
},
|
||||
];
|
|
@ -17,8 +17,8 @@
|
|||
"lint:yml": "yamllint --schema=CORE_SCHEMA *.{yml,yaml}",
|
||||
"lint:js": "npm run lint:eslint && npm run lint:prettier",
|
||||
"lint:js:fix": "npm run lint:eslint:fix && npm run lint:prettier:fix",
|
||||
"lint:eslint": "eslint \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs}\" --ignore-path .gitignore",
|
||||
"lint:eslint:fix": "eslint --fix \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs}\" --ignore-path .gitignore",
|
||||
"lint:eslint": "eslint \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs}\" --ignore-pattern '.gitignore'",
|
||||
"lint:eslint:fix": "eslint --fix \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs}\" --ignore-pattern '.gitignore'",
|
||||
"lint:prettier": "prettier --check \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs,json}\" --ignore-path .gitignore",
|
||||
"lint:prettier:fix": "prettier --write \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs,json}\" --ignore-path .gitignore",
|
||||
"docker": "docker build . && docker run --rm -i -p 8080:8080 $(docker build -q .)"
|
||||
|
|
Loading…
Reference in a new issue