feat: linting
This commit is contained in:
parent
194f699b40
commit
6bc3033a8c
3 changed files with 2833 additions and 130 deletions
102
eslint.config.js
Normal file
102
eslint.config.js
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
import js from '@eslint/js';
|
||||
import tseslint from 'typescript-eslint';
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
import unusedImports from 'eslint-plugin-unused-imports';
|
||||
|
||||
export default tseslint.config(
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
{
|
||||
plugins: {
|
||||
'@typescript-eslint': tseslint.plugin,
|
||||
'import': importPlugin,
|
||||
'unused-imports': unusedImports,
|
||||
},
|
||||
languageOptions: {
|
||||
parser: tseslint.parser,
|
||||
parserOptions: {
|
||||
project: './tsconfig.json',
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Core rules - all as errors
|
||||
'max-classes-per-file': ['error', 1],
|
||||
'prefer-const': 'error',
|
||||
|
||||
// TypeScript specific rules
|
||||
'@typescript-eslint/no-floating-promises': 'error',
|
||||
|
||||
// Import rules
|
||||
'import/order': ['error', {
|
||||
'groups': [
|
||||
'builtin',
|
||||
'external',
|
||||
'internal',
|
||||
'parent',
|
||||
'sibling',
|
||||
'index',
|
||||
],
|
||||
'newlines-between': 'always',
|
||||
'alphabetize': {
|
||||
'order': 'asc',
|
||||
'caseInsensitive': true,
|
||||
},
|
||||
}],
|
||||
'import/no-default-export': 'error',
|
||||
|
||||
// Unused code detection
|
||||
'no-unused-vars': 'off',
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'unused-imports/no-unused-imports': 'error',
|
||||
'unused-imports/no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
'vars': 'all',
|
||||
'varsIgnorePattern': '^_',
|
||||
'args': 'after-used',
|
||||
'argsIgnorePattern': '^_',
|
||||
},
|
||||
],
|
||||
|
||||
// Turn off rules that might be too strict
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
|
||||
// Allow console for CLI tool
|
||||
'no-console': 'off',
|
||||
},
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
typescript: true,
|
||||
node: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
// Allow default exports in specific files
|
||||
files: ['src/index.ts', '*.config.js', '*.config.ts'],
|
||||
rules: {
|
||||
'import/no-default-export': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
// Test files can have different rules
|
||||
files: ['**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts', '**/*.spec.tsx'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: [
|
||||
'dist/**',
|
||||
'node_modules/**',
|
||||
'coverage/**',
|
||||
'*.d.ts',
|
||||
'src/__mocks__/**',
|
||||
],
|
||||
},
|
||||
);
|
||||
2851
package-lock.json
generated
2851
package-lock.json
generated
File diff suppressed because it is too large
Load diff
10
package.json
10
package.json
|
|
@ -17,7 +17,10 @@
|
|||
"dev": "tsx src/index.ts",
|
||||
"repomix:sdk": "npx repomix node_modules/@continuedev/sdk --ignore **/api,cli-repomix.xml -o sdk-repomix.xml",
|
||||
"repomix:cli": "npx repomix --ignore sdk-repomix.xml -o cli-repomix.xml",
|
||||
"lint": "tsc --noEmit",
|
||||
"lint": "tsc --noEmit && eslint .",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"watch:logs": "tail -f ~/.continue/logs/cn.log",
|
||||
"prepare": "npm run build",
|
||||
"semantic-release": "semantic-release",
|
||||
"semantic-release:dry-run": "semantic-release --dry-run"
|
||||
|
|
@ -86,9 +89,14 @@
|
|||
"@types/nock": "^10.0.3",
|
||||
"@types/readline-sync": "^1.4.8",
|
||||
"@types/supertest": "^6.0.3",
|
||||
"@typescript-eslint/eslint-plugin": "^8.39.0",
|
||||
"@typescript-eslint/parser": "^8.39.0",
|
||||
"@vitest/ui": "^3.2.4",
|
||||
"conventional-changelog-conventionalcommits": "^9.1.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^9.32.0",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-unused-imports": "^4.1.4",
|
||||
"execa": "^9.6.0",
|
||||
"express": "^5.1.0",
|
||||
"happy-dom": "^18.0.1",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue