Skip to content

Commit a5d20d0

Browse files
authored
Update ESLint (#70)
* updated eslint * fixed some linting errors * --no-warn-ignored to lint test * fixed missing semicolons * fixed missing commas
1 parent f3d8187 commit a5d20d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+721
-662
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 36 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
2+
import globals from 'globals';
3+
import tsParser from '@typescript-eslint/parser';
4+
import path from 'node:path';
5+
import { fileURLToPath } from 'node:url';
6+
import js from '@eslint/js';
7+
import { FlatCompat } from '@eslint/eslintrc';
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all,
16+
});
17+
18+
export default [
19+
{
20+
ignores: ['**/*.*js'],
21+
},
22+
...compat.extends('eslint:recommended', 'plugin:@typescript-eslint/recommended'),
23+
{
24+
plugins: {
25+
'@typescript-eslint': typescriptEslint,
26+
},
27+
28+
languageOptions: {
29+
globals: {
30+
...globals.node,
31+
},
32+
33+
parser: tsParser,
34+
ecmaVersion: 'latest',
35+
sourceType: 'module',
36+
37+
parserOptions: {
38+
project: ['./tsconfig.json'],
39+
tsconfigRootDir: '/home/me/work/astra-db-ts',
40+
},
41+
},
42+
43+
rules: {
44+
// We are *way* past this point lmao
45+
'@typescript-eslint/no-explicit-any': 'off',
46+
47+
// Only way I can do indentation in ts-doc
48+
'no-irregular-whitespace': 'off',
49+
50+
// Makes underscore variables not throw a fit
51+
'@typescript-eslint/no-unused-vars': ['error', {
52+
argsIgnorePattern: '^_',
53+
varsIgnorePattern: '^_',
54+
caughtErrorsIgnorePattern: '^_',
55+
}],
56+
57+
// Sometimes 'requires' is necessary
58+
'@typescript-eslint/no-require-imports': 'off',
59+
60+
// https://stackoverflow.com/questions/49743842/javascript-unexpected-control-characters-in-regular-expression
61+
'no-control-regex': 'off',
62+
63+
'semi': 'error',
64+
'comma-dangle': ['error', 'always-multiline'],
65+
},
66+
},
67+
];

0 commit comments

Comments
 (0)