Skip to content

Commit 2f4b3ae

Browse files
committed
inicial config with prettier eslint editorconfig
1 parent 433425e commit 2f4b3ae

9 files changed

+1301
-9
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
end_of_line = lf

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/*.js
2+
node_modules
3+
dist

.eslintrc.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"env": {
3+
"es6": true,
4+
"node": true
5+
},
6+
"extends": [
7+
"airbnb-base",
8+
"plugin:@typescript-eslint/recommended",
9+
"prettier/@typescript-eslint",
10+
"plugin:prettier/recommended"
11+
],
12+
"globals": {
13+
"Atomics": "readonly",
14+
"SharedArrayBuffer": "readonly"
15+
},
16+
"parser": "@typescript-eslint/parser",
17+
"parserOptions": {
18+
"ecmaVersion": 2018,
19+
"sourceType": "module"
20+
},
21+
"plugins": [
22+
"@typescript-eslint",
23+
"prettier"
24+
],
25+
"rules": {
26+
"import/extensions": [
27+
"error",
28+
"ignorePackages",
29+
{
30+
"ts": "never"
31+
}
32+
],
33+
"prettier/prettier": "error"
34+
},
35+
"settings": {
36+
"import/resolver": {
37+
"typescript": {}
38+
}
39+
}
40+
}

package.json

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@
1111
"express": "^4.17.1"
1212
},
1313
"devDependencies": {
14+
"@typescript-eslint/eslint-plugin": "^3.10.1",
15+
"@typescript-eslint/parser": "^3.10.1",
16+
"eslint": "6.8.0",
17+
"eslint-config-airbnb-base": "^14.2.0",
18+
"eslint-config-prettier": "^6.11.0",
19+
"eslint-import-resolver-typescript": "^2.2.1",
20+
"eslint-plugin-import": "2.21.2",
21+
"eslint-plugin-prettier": "^3.1.4",
22+
"prettier": "^2.1.1",
1423
"ts-node-dev": "^1.0.0-pre.61",
1524
"typescript": "^4.0.2"
1625
}

prettier.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
singleQuote: true,
3+
trailingComma: 'all',
4+
arrowParens: 'avoid',
5+
}

src/app.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import express from 'express';
2+
import routes from './routes';
3+
4+
const app = express();
5+
app.use(express.json());
6+
app.use(routes);
7+
8+
export default app;

src/routes/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { Router } from 'express';
2+
3+
const routes = Router();
4+
export default routes;

src/server.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import app from './app';
2+
3+
app.listen(3333, () => {
4+
console.log('Server started on port 3333!');
5+
});

0 commit comments

Comments
 (0)