[tests] add editorconfig and eslint

This commit is contained in:
Dragan Filipovic 2020-04-11 16:26:19 +02:00
parent c28aa7215e
commit 19689edd76
4 changed files with 44 additions and 2 deletions

11
.editorconfig Normal file
View File

@ -0,0 +1,11 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 4
trim_trailing_whitespace = true

25
.eslintrc.js Normal file
View File

@ -0,0 +1,25 @@
module.exports = {
env: {
commonjs: true,
es6: true,
node: true
},
extends: [
'airbnb-base'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaVersion: 2018,
},
rules: {
"comma-dangle": [
"error",
"never"
],
"no-console": "off",
"object-curly-newline": "off"
}
};

2
.gitignore vendored
View File

@ -17,3 +17,5 @@ node_modules/
.env
.env.test
# Ide
.idea

View File

@ -9,10 +9,14 @@
"rsyncwrapper": "3.0.1"
},
"devDependencies": {
"@zeit/ncc": "^0.20.5"
"@zeit/ncc": "^0.20.5",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-plugin-import": "^2.20.2"
},
"scripts": {
"build": "ncc build ./src/index.js -o dist"
"build": "npm run lint && ncc build ./src/index.js -o dist",
"lint": "eslint ./src/index.js"
},
"repository": {
"type": "git",