feat: оформить Harness Lab с изолированным экспериментом Pi Retro
Разделить библиотеку, эксперименты, результаты и принятые инструменты. Сохранить профиль качества TypeScript и практики проверки навыков, убрать обёртки Pi и создавать handoff только по запросу.
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
import js from '@eslint/js';
|
||||
import { defineConfig } from 'eslint/config';
|
||||
import importX from 'eslint-plugin-import-x';
|
||||
import sonarjs from 'eslint-plugin-sonarjs';
|
||||
import globals from 'globals';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
// Adapted from ../../library/code-quality-practices/typescript/work-harness.md.
|
||||
// Only this extension, its tests and this config are in the adoption scope.
|
||||
const files = ['src/**/*.ts', 'tests/**/*.{ts,mjs}', 'eslint.config.mjs'];
|
||||
const typedFiles = ['src/**/*.ts', 'tests/**/*.ts'];
|
||||
|
||||
export default defineConfig(
|
||||
{
|
||||
files,
|
||||
extends: [js.configs.recommended],
|
||||
languageOptions: { globals: globals.node },
|
||||
linterOptions: {
|
||||
noInlineConfig: true,
|
||||
reportUnusedDisableDirectives: 'error',
|
||||
reportUnusedInlineConfigs: 'error',
|
||||
},
|
||||
rules: {
|
||||
'array-callback-return': ['error', { checkForEach: true }],
|
||||
eqeqeq: ['error', 'always'],
|
||||
curly: ['error', 'all'],
|
||||
'no-console': 'error',
|
||||
'no-eval': 'error',
|
||||
'no-implicit-coercion': 'error',
|
||||
'no-promise-executor-return': 'error',
|
||||
'no-return-assign': ['error', 'always'],
|
||||
'no-unmodified-loop-condition': 'error',
|
||||
'no-unreachable-loop': 'error',
|
||||
'no-unsafe-optional-chaining': 'error',
|
||||
'prefer-const': 'error',
|
||||
'prefer-promise-reject-errors': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: typedFiles,
|
||||
extends: [
|
||||
tseslint.configs.strictTypeChecked,
|
||||
importX.flatConfigs.recommended,
|
||||
importX.flatConfigs.typescript,
|
||||
sonarjs.configs.recommended,
|
||||
],
|
||||
languageOptions: {
|
||||
parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname },
|
||||
},
|
||||
settings: {
|
||||
'import-x/resolver': { typescript: { project: './tsconfig.json' } },
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/consistent-type-imports': [
|
||||
'error',
|
||||
{ fixStyle: 'separate-type-imports' },
|
||||
],
|
||||
'@typescript-eslint/consistent-type-exports': 'error',
|
||||
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }],
|
||||
'@typescript-eslint/no-floating-promises': [
|
||||
'error',
|
||||
{ ignoreVoid: false, ignoreIIFE: false },
|
||||
],
|
||||
'@typescript-eslint/no-misused-promises': 'error',
|
||||
'@typescript-eslint/strict-boolean-expressions': 'error',
|
||||
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
||||
'@typescript-eslint/no-shadow': 'error',
|
||||
'@typescript-eslint/return-await': ['error', 'error-handling-correctness-only'],
|
||||
'max-lines-per-function': [
|
||||
'error',
|
||||
{ max: 80, IIFEs: true, skipBlankLines: true, skipComments: true },
|
||||
],
|
||||
'sonarjs/cognitive-complexity': ['error', 10],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['tests/**/*.{ts,mjs}'],
|
||||
rules: {
|
||||
// A scenario keeps setup, action and assertions together; production stays at 80.
|
||||
'max-lines-per-function': 'off',
|
||||
},
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user