Skip to content

Commit bd11864

Browse files
authored
style: add prettier and eslint (#328)
* style: execute prettier on all code files build: add prettier to devDependencies * refactor: var to const/let * build: add simple eslint config & packages * refactor: optimize re-export of "is-ip" * refactor: optimize re-export of "is-ip" * chore: update eslint config * style: execute prettier on all code files chore: update prettier config * build: remove eslint-plugin-prettier * chore: add editorconfig * chore: update npm eslint script and cleanup eslint config file
1 parent e5fddbb commit bd11864

File tree

14 files changed

+1235
-541
lines changed

14 files changed

+1235
-541
lines changed

.editorconfig

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

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"bracketSpacing": false,
3+
"printWidth": 80,
4+
"semi": true,
5+
"singleQuote": true,
6+
"tabWidth": 2,
7+
"trailingComma": "none",
8+
"useTabs": false,
9+
"arrowParens": "always"
10+
}

eslint.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import js from '@eslint/js';
2+
import mocha from 'eslint-plugin-mocha';
3+
export default [
4+
mocha.configs.flat.recommended,
5+
{
6+
...js.configs.recommended,
7+
files: ['**/*.js']
8+
}
9+
];

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import fn from "./lib/http.js";
1+
import fn from './lib/http.js';
22
export default fn;

0 commit comments

Comments
 (0)