Skip to content

Commit f5d1c51

Browse files
committed
Add eslint dependencies and configuration
1 parent 7be90b2 commit f5d1c51

File tree

3 files changed

+1533
-20
lines changed

3 files changed

+1533
-20
lines changed

eslint.config.mjs

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* Copyright (C) 2024 brittni and the polar bear LLC.
3+
*
4+
* This file is a part of brittni and the polar bear's p5.js TypeScript template,
5+
* which is released under the GNU Affero General Public License, Version 3.0.
6+
* You may not use this file except in compliance with the license.
7+
*
8+
* You should have received a copy of the GNU Affero General Public License
9+
* along with this program. See LICENSE or go to
10+
* https://www.gnu.org/licenses/agpl-3.0.en.html for full license details.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15+
* See the GNU Affero General Public License for more details.
16+
*/
17+
18+
import eslint from '@eslint/js';
19+
20+
import stylistic from '@stylistic/eslint-plugin'
21+
22+
import tsEslint from 'typescript-eslint';
23+
24+
export default tsEslint.config(
25+
eslint.configs.recommended,
26+
stylistic.configs['recommended-flat'],
27+
...tsEslint.configs.recommendedTypeChecked,
28+
...tsEslint.configs.strictTypeChecked,
29+
...tsEslint.configs.stylisticTypeChecked,
30+
{
31+
languageOptions: {
32+
parserOptions: {
33+
projectService: true,
34+
tsconfigRootDir: import.meta.dirname,
35+
},
36+
},
37+
rules: {
38+
/* @stylistic/eslint-plugin */
39+
40+
'@stylistic/brace-style': ['error', '1tbs'],
41+
42+
'@stylistic/no-extra-semi': 'error',
43+
44+
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
45+
46+
'@stylistic/function-call-spacing': ['error', 'never'],
47+
48+
'@stylistic/comma-dangle': ['error', 'never'],
49+
50+
'@stylistic/indent': ['error',
51+
4,
52+
{
53+
SwitchCase: 1,
54+
FunctionDeclaration: {
55+
parameters: 'first'
56+
},
57+
FunctionExpression: {
58+
parameters: 'first'
59+
}
60+
}
61+
],
62+
63+
'@stylistic/indent-binary-ops': 'off',
64+
65+
'@stylistic/member-delimiter-style': ['error', {
66+
multiline: {
67+
delimiter: 'semi',
68+
requireLast: true
69+
},
70+
singleline: {
71+
delimiter: 'semi',
72+
requireLast: true
73+
}
74+
}],
75+
76+
'@stylistic/operator-linebreak': ['error', 'after'],
77+
78+
'@stylistic/quotes': ['error',
79+
'single',
80+
{
81+
avoidEscape: true,
82+
allowTemplateLiterals: true
83+
}
84+
],
85+
86+
'@stylistic/semi': ['error', 'always']
87+
}
88+
}
89+
);

0 commit comments

Comments
 (0)