mirror of
https://github.com/thelegendtubaguy/ArrQueueCleaner.git
synced 2025-12-16 18:14:44 -06:00
* Added No files rule * Spacing was way off :( * Added eslint and pr workflow for eslint * Removed test only pr workflow pr, replaced with lint and test
89 lines
2.1 KiB
JavaScript
89 lines
2.1 KiB
JavaScript
// @ts-check
|
|
|
|
import eslint from '@eslint/js';
|
|
import tseslint from 'typescript-eslint';
|
|
|
|
export default tseslint.config(
|
|
// Apply recommended rules
|
|
eslint.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
...tseslint.configs.strict,
|
|
...tseslint.configs.stylistic,
|
|
|
|
// Global configuration
|
|
{
|
|
languageOptions: {
|
|
parserOptions: {
|
|
project: './tsconfig.eslint.json',
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
},
|
|
|
|
// File-specific configurations
|
|
{
|
|
files: ['**/*.ts', '**/*.tsx'],
|
|
rules: {
|
|
// TypeScript-specific rules
|
|
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'@typescript-eslint/no-var-requires': 'error',
|
|
'@typescript-eslint/no-inferrable-types': 'error',
|
|
|
|
// Code quality
|
|
'no-console': 'off', // Allow console for this CLI app
|
|
'prefer-const': 'error',
|
|
'no-var': 'error',
|
|
'eqeqeq': ['error', 'always'],
|
|
'curly': ['error', 'all'],
|
|
|
|
// Style consistency
|
|
'indent': ['error', 4],
|
|
'quotes': ['error', 'single'],
|
|
'semi': ['error', 'always'],
|
|
'comma-dangle': ['error', 'never'],
|
|
'object-curly-spacing': ['error', 'always'],
|
|
'array-bracket-spacing': ['error', 'never'],
|
|
},
|
|
},
|
|
|
|
// Test files configuration
|
|
{
|
|
files: ['**/*.test.ts', '**/*.spec.ts', 'tests/**/*.ts'],
|
|
rules: {
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'no-console': 'off',
|
|
},
|
|
},
|
|
|
|
// Configuration files
|
|
{
|
|
files: ['*.config.js', '*.config.mjs', '*.config.ts'],
|
|
languageOptions: {
|
|
globals: {
|
|
module: 'readonly',
|
|
require: 'readonly',
|
|
__dirname: 'readonly',
|
|
process: 'readonly',
|
|
},
|
|
parserOptions: {
|
|
project: null,
|
|
},
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/no-var-requires': 'off',
|
|
},
|
|
},
|
|
|
|
// Ignore patterns
|
|
{
|
|
ignores: [
|
|
'dist/**',
|
|
'node_modules/**',
|
|
'coverage/**',
|
|
'*.d.ts',
|
|
],
|
|
}
|
|
);
|