Skip to content

Commit 37f0f63

Browse files
committed
Add project files.
0 parents  commit 37f0f63

7 files changed

+2769
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 2
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/node_modules

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Infermedica
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Infermedica ESLint configuration
2+
3+
ESLint configuration for Vue.js projects.
4+
5+
## Install
6+
7+
```bash
8+
npm i @infermedica/eslint-config-vue --save-dev
9+
```
10+
11+
## Usage
12+
13+
This config is designed to work with the `extends` feature of `.eslintrc` files,
14+
[learn more](http://eslint.org/docs/developer-guide/shareable-configs).
15+
16+
Add this to your `.eslintrc` or `package.json` file:
17+
18+
```
19+
{
20+
"extends": "@infermedica/eslint-config-vue"
21+
}
22+
```
23+
24+
You can override settings from this config by adding them directly into your
25+
`.eslintrc` or `package.json` file.
26+
27+
#### Commands
28+
29+
Recommended set of commands to put in `package.json` scripts:
30+
31+
```
32+
"lint:js": "eslint --ext .js,.vue .",
33+
"lint-autofix:js": "eslint --ext .js,.vue . --fix",
34+
```
35+
36+
## License
37+
38+
MIT Copyright (c) Infermedica

index.js

+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
node: true
6+
},
7+
extends: [
8+
'airbnb-base',
9+
'plugin:vue/recommended',
10+
'plugin:promise/recommended'
11+
],
12+
parserOptions: {
13+
ecmaVersion: 2018,
14+
sourceType: 'module',
15+
parser: 'babel-eslint'
16+
},
17+
globals: {
18+
process: false
19+
},
20+
rules: {
21+
'quotes': ['error', 'single'],
22+
'no-unused-vars': ['error', {
23+
args: 'none'
24+
}],
25+
'comma-dangle': ['error', 'never'],
26+
'object-curly-spacing': ['error', 'never'],
27+
'max-len': ['error', {
28+
code: 119,
29+
ignoreRegExpLiterals: true
30+
}],
31+
'no-param-reassign': ['error', {
32+
props: false
33+
}],
34+
'no-unused-expressions': ['error', {
35+
allowShortCircuit: true, allowTernary: true
36+
}],
37+
'arrow-parens': ['error', 'always'],
38+
'import/no-extraneous-dependencies': ['error', {
39+
devDependencies: true,
40+
optionalDependencies: false
41+
}],
42+
'no-restricted-syntax': [
43+
'error',
44+
{
45+
selector: 'ForInStatement',
46+
message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.'
47+
},
48+
{
49+
selector: 'LabeledStatement',
50+
message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.'
51+
},
52+
{
53+
selector: 'WithStatement',
54+
message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.'
55+
}
56+
],
57+
58+
// Vue
59+
'vue/html-self-closing': ['error', {
60+
html: {
61+
normal: 'never',
62+
void: 'always'
63+
}
64+
}],
65+
'vue/script-indent': ['warn', 2, {
66+
baseIndent: 1,
67+
switchCase: 1
68+
}],
69+
'vue/html-closing-bracket-newline': ['error', {
70+
singleline: 'never',
71+
multiline: 'never'
72+
}],
73+
'vue/html-closing-bracket-spacing': ['error', {
74+
startTag: 'never',
75+
endTag: 'never',
76+
selfClosingTag: 'never'
77+
}],
78+
// TODO: 'vue/attributes-order':
79+
'vue/order-in-components': ['warn', {
80+
order: [
81+
'el',
82+
'name',
83+
'parent',
84+
'functional',
85+
'inheritAttrs',
86+
'model',
87+
'extends',
88+
'mixins',
89+
['props', 'propsData'],
90+
'data',
91+
'computed',
92+
'methods',
93+
'watch',
94+
'LIFECYCLE_HOOKS',
95+
['components', 'directives', 'filters'],
96+
['delimiters', 'comments'],
97+
['template', 'render'],
98+
'renderError'
99+
]
100+
}],
101+
102+
// off
103+
'no-new': 'off',
104+
'no-shadow': 'off',
105+
'func-names': 'off',
106+
'no-console': 'off',
107+
'no-plusplus': 'off',
108+
'arrow-body-style': 'off',
109+
'no-prototype-builtins': 'off',
110+
'prefer-deconstructing': 'off',
111+
'promise/catch-or-return': 'off',
112+
'vue/max-attributes-per-line': 'off',
113+
'vue/singleline-html-element-content-newline': 'off'
114+
},
115+
overrides: [
116+
{
117+
files: ['*.vue'],
118+
rules: {
119+
indent: 'off'
120+
}
121+
},
122+
{
123+
files: ['*.js'],
124+
rules: {
125+
'vue/script-indent': 'off'
126+
}
127+
}
128+
],
129+
settings: {
130+
'import/resolver': 'webpack'
131+
}
132+
};

0 commit comments

Comments
 (0)