Skip to content

Commit 0b1a6d6

Browse files
restfulheadPatrick Ruhkopf
authored andcommitted
chore: add eslint
1 parent edc3a92 commit 0b1a6d6

17 files changed

+2724
-279
lines changed

.eslintrc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: false,
5+
es6: false,
6+
node: true,
7+
},
8+
parser: '@typescript-eslint/parser',
9+
extends: [
10+
'plugin:@typescript-eslint/recommended', // uses the recommended rules from the @typescript-eslint/eslint-plugin
11+
'plugin:import/errors',
12+
'plugin:import/warnings',
13+
'plugin:import/typescript',
14+
'plugin:prettier/recommended', // enables eslint-plugin-prettier and displays prettier errors as eslint errors. Make sure this is always the last configuration in the extends array.
15+
],
16+
plugins: ['prettier', 'import', 'unused-imports'],
17+
rules: {
18+
'import/no-unresolved': ['error', { ignore: ['^@bertelsmann-dev'] }],
19+
'require-await': 'error',
20+
},
21+
settings: {
22+
'import/resolver': {
23+
typescript: {},
24+
},
25+
},
26+
}

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 140,
3+
"singleQuote": true,
4+
"semi": false,
5+
"htmlWhitespaceSensitivity": "ignore",
6+
"trailingComma": "es5",
7+
"useTabs": false,
8+
"tabWidth": 2
9+
}

.vscode/settings.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,29 @@
66
"debug.internalConsoleOptions": "neverOpen",
77
"azureFunctions.projectLanguageModel": 4,
88
"azureFunctions.projectSubpath": "example",
9-
"azureFunctions.preDeployTask": "npm prune (functions)"
9+
"azureFunctions.preDeployTask": "npm prune (functions)",
10+
11+
// Place your settings in this file to overwrite default and user settings.
12+
{
13+
"git.ignoreLimitWarning": true,
14+
"typescript.referencesCodeLens.enabled": true,
15+
"typescript.preferences.importModuleSpecifier": "relative",
16+
"editor.rulers": [
17+
140
18+
],
19+
"editor.formatOnSave": false,
20+
"editor.codeActionsOnSave": {
21+
"source.fixAll.eslint": "explicit"
22+
},
23+
"editor.defaultFormatter": "esbenp.prettier-vscode",
24+
"typescript.format.enable": false,
25+
"javascript.format.enable": false,
26+
"json.format.enable": true,
27+
"[json]": {
28+
"editor.formatOnSave": true
29+
},
30+
"eslint.workingDirectories": ["example", "src", "test"],
31+
"eslint.options": {
32+
"resolvePluginsRelativeTo": "."
33+
},
1034
}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
Azurite start
44
npm run watch
55

6-
TODO: eslint
6+
TODO: refactor hooks
7+
TODO: allow excluding paths
8+
TODO: options to log, throw, etc.

example/.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
project: 'tsconfig.json',
5+
sourceType: 'module',
6+
},
7+
extends: ["../.eslintrc.js"]
8+
}
9+

example/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
"devDependencies": {
2020
"@types/js-yaml": "4.0.9",
2121
"@types/node": "^18.x",
22+
"@typescript-eslint/eslint-plugin": "6.16.0",
23+
"@typescript-eslint/parser": "6.16.0",
24+
"eslint": "8.56.0",
25+
"eslint-config-prettier": "9.1.0",
26+
"eslint-plugin-import": "2.29.1",
27+
"eslint-plugin-prettier": "5.1.2",
28+
"eslint-import-resolver-typescript": "3.6.1",
29+
"eslint-plugin-unused-imports": "3.0.0",
30+
"prettier": "3.1.1",
2231
"typescript": "^4.0.0",
2332
"rimraf": "^5.0.0"
2433
},

0 commit comments

Comments
 (0)