From 6cd31b3efb5dd18e35a62173a98bc859edbc9890 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 12 Jul 2026 04:11:08 +0000 Subject: [PATCH] Update configuration files --- .prettierrc.json | 10 +++++++ eslint.config.mjs | 74 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 .prettierrc.json create mode 100644 eslint.config.mjs diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..b243c2f --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,10 @@ +{ + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "semi": true, + "singleQuote": true, + "trailingComma": "none", + "bracketSpacing": false, + "arrowParens": "avoid" +} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..1d06401 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,74 @@ +// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update. +import js from '@eslint/js'; +import tsParser from '@typescript-eslint/parser'; +import tsPlugin from '@typescript-eslint/eslint-plugin'; +import jest from 'eslint-plugin-jest'; +import n from 'eslint-plugin-n'; +import prettier from 'eslint-config-prettier'; +import globals from 'globals'; + +export default [ + { + ignores: ['**/*', '!src/**', '!__tests__/**'] + }, + js.configs.recommended, + { + files: ['**/*.ts'], + languageOptions: { + parser: tsParser, + ecmaVersion: 2022, + sourceType: 'module', + globals: { + ...globals.node, + ...globals.es2015 + } + }, + plugins: { + '@typescript-eslint': tsPlugin, + n + }, + rules: { + ...tsPlugin.configs.recommended.rules, + '@typescript-eslint/no-require-imports': 'error', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/ban-ts-comment': [ + 'error', + { + 'ts-ignore': 'allow-with-description' + } + ], + 'no-console': 'error', + yoda: 'error', + 'prefer-const': [ + 'error', + { + destructuring: 'all' + } + ], + 'no-control-regex': 'off', + 'no-constant-condition': ['error', {checkLoops: false}], + 'no-undef': 'off', + 'no-useless-assignment': 'off', + 'n/no-extraneous-import': 'error' + } + }, + { + files: ['**/*{test,spec}.ts'], + plugins: {jest}, + languageOptions: { + globals: { + ...globals.jest + } + }, + rules: { + ...jest.configs['flat/recommended'].rules, + '@typescript-eslint/no-unused-vars': 'off', + 'jest/no-standalone-expect': 'off', + 'jest/no-conditional-expect': 'off', + 'no-console': 'off' + } + }, + prettier +];