Skip to content

Commit d81d6a3

Browse files
committed
chore: add eslint rules for naming convention and function declaration
1 parent f04cb13 commit d81d6a3

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

eslint.config.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import { fileURLToPath } from 'node:url';
77
import ts from 'typescript-eslint';
88
import svelteConfig from './svelte.config.js';
99

10-
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
10+
const gitignore_path = fileURLToPath(new URL('./.gitignore', import.meta.url));
1111

1212
export default ts.config(
13-
includeIgnoreFile(gitignorePath),
13+
includeIgnoreFile(gitignore_path),
1414
js.configs.recommended,
1515
...ts.configs.recommended,
1616
...svelte.configs.recommended,
@@ -24,6 +24,15 @@ export default ts.config(
2424
// typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
2525
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
2626
'no-undef': 'off',
27+
'@typescript-eslint/naming-convention': [
28+
'error',
29+
{
30+
selector: ['variableLike'],
31+
format: ['snake_case', 'UPPER_CASE'],
32+
leadingUnderscore: 'allow',
33+
},
34+
],
35+
'func-style': ['error', 'declaration', { allowTypeAnnotation: true }],
2736
},
2837
},
2938
{

0 commit comments

Comments
 (0)