Skip to content

Commit 36bef71

Browse files
committed
chore: configure prettier and eslint on the repo
1 parent 7c1c96e commit 36bef71

File tree

6 files changed

+1137
-2
lines changed

6 files changed

+1137
-2
lines changed

.devcontainer/devcontainer.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
{
22
"image": "ghcr.io/mrsimonemms/devcontainers/full",
33
"name": "devcontainer",
4-
"features": {},
4+
"features": {
5+
"ghcr.io/devcontainers-contrib/features/npm-package:1": {
6+
"package": "plop"
7+
}
8+
},
59
"customizations": {
610
"vscode": {
711
"extensions": [
8-
"ms-vscode.makefile-tools"
12+
"ms-vscode.makefile-tools",
13+
"esbenp.prettier-vscode"
914
],
1015
"settings": {}
1116
}

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 80
5+
}

.vscode/settings.json

+6
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77
"https://json.schemastore.org/github-workflow.json": [
88
".github/workflows/*.{yml,yaml}"
99
]
10+
},
11+
"[javascript]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
14+
"[typescript]": {
15+
"editor.defaultFormatter": "esbenp.prettier-vscode"
1016
}
1117
}

eslint.config.mjs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2024 Simon Emms <simon@simonemms.com>
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import globals from 'globals';
18+
import pluginJs from '@eslint/js';
19+
import eslintConfigPrettier from 'eslint-config-prettier';
20+
21+
export default [
22+
{ files: ['**/*.js'], languageOptions: { sourceType: 'commonjs' } },
23+
{ languageOptions: { globals: globals.node } },
24+
pluginJs.configs.recommended,
25+
eslintConfigPrettier,
26+
];

0 commit comments

Comments
 (0)