Skip to content

Commit 820a021

Browse files
committed
Add project files
1 parent 11af39f commit 820a021

File tree

7 files changed

+1461
-0
lines changed

7 files changed

+1461
-0
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = tab
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[{*.json,*.yml,*.yaml}]
15+
indent_size = 2
16+
indent_style = space

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/node_modules/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Web Scrobbler Team
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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# eslint-config-web-scrobbler
2+
3+
ESLint configuration file for Web Scrobbler projects.
4+
5+
## Usage
6+
7+
You can install `eslint-config-web-scrobbler` by a following way:
8+
```sh
9+
> npm install --save-dev eslint-config-web-scrobbler
10+
```
11+
12+
Then, add `eslint-config-web-scrobbler` to the `extends` array in your
13+
`.eslintrc.*` file.
14+
```json
15+
{
16+
"extends": [
17+
"some-other-config-you-use",
18+
"web-scrobbler"
19+
]
20+
}
21+
```
22+
23+
## License
24+
25+
Licensed under the [MIT License](./LICENSE)

index.js

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
'use strict';
2+
3+
module.exports = {
4+
'env': {
5+
'es6': true,
6+
'node': true,
7+
},
8+
'extends': [
9+
'eslint:recommended'
10+
],
11+
'plugins': [
12+
'jsdoc'
13+
],
14+
'rules': {
15+
/*
16+
* Possible errors
17+
*/
18+
19+
// Enforce "for" loop update clause moving the counter
20+
// in the right direction
21+
'for-direction': 'error',
22+
23+
// Disallow unnecessary parentheses
24+
'no-extra-parens': 'error',
25+
26+
// Disallow template literal placeholder syntax in regular string
27+
'no-template-curly-in-string': 'error',
28+
29+
/*
30+
* Best practices
31+
*/
32+
33+
// Enforce consistent brace style for all control statements
34+
'curly': 'error',
35+
36+
// Require the use of === and !==
37+
'eqeqeq': 'error',
38+
39+
// Disallow `else` blocks after `return` statements in `if` statements
40+
'no-else-return': 'error',
41+
42+
// Disallow empty functions
43+
'no-empty-function': 'error',
44+
45+
// Disallow function declarations and expressions inside loop statements
46+
'no-loop-func': 'error',
47+
48+
// Disallow new operators with the String, Number, and Boolean objects
49+
'no-new-wrappers': 'error',
50+
51+
// Disallow reassigning function parameters
52+
'no-param-reassign': 'error',
53+
54+
// Disallow unnecessary concatenation of strings
55+
'no-useless-concat': 'error',
56+
57+
// Disallow redundant return statements
58+
'no-useless-return': 'error',
59+
60+
/*
61+
* Strict mode
62+
*/
63+
64+
// Require global strict mode directive
65+
'strict': ['error', 'global'],
66+
67+
/*
68+
* Stylistic issues
69+
*/
70+
71+
// Require 'one true brace style', in which the opening brace
72+
// of a block is placed on the same line as its corresponding
73+
// statement or declaration
74+
'brace-style': ['error', '1tbs'],
75+
76+
// Disallow spaces inside of brackets
77+
'array-bracket-spacing': ['error', 'never'],
78+
79+
// Require CamelCase
80+
'camelcase': ['error', { 'properties': 'never' }],
81+
82+
// Require space after comma
83+
'comma-spacing': ['error', { 'after': true }],
84+
85+
// Require newline at the end of files
86+
'eol-last': ['error', 'always'],
87+
88+
// Disallow spacing between function identifiers and their invocations
89+
'func-call-spacing': 'error',
90+
91+
// Use tabs as indentation
92+
// Enforce indentation level for case clauses in switch statements
93+
'indent': [
94+
'error', 'tab', { 'SwitchCase': 1 }
95+
],
96+
97+
// Require space after colon in object literal properties
98+
'key-spacing': [
99+
'error', { 'afterColon': true }
100+
],
101+
102+
// Require space before and after keywords
103+
'keyword-spacing': 'error',
104+
105+
// Require Unix line endings
106+
'linebreak-style': ['error', 'unix'],
107+
108+
// Disallow empty block statements
109+
'no-empty': [
110+
'error', { 'allowEmptyCatch': true }
111+
],
112+
113+
// Disallow `if` statements as the only statement in `else` blocks
114+
'no-lonely-if': 'error',
115+
116+
// Disallow multiple spaces
117+
'no-multi-spaces': 'error',
118+
119+
// Disallow nested ternary expressions
120+
'no-nested-ternary': 'error',
121+
122+
// Disallow trailing whitespace at the end of lines
123+
'no-trailing-spaces': 'error',
124+
125+
// Disallow ternary operators when simpler alternatives exist
126+
'no-unneeded-ternary': 'error',
127+
128+
// Disallow whitespace before properties
129+
'no-whitespace-before-property': 'error',
130+
131+
'one-var': ['error', 'never'],
132+
133+
// Require spaces inside curly braces
134+
'object-curly-spacing': ['error', 'always'],
135+
136+
// Require single quotes
137+
'quotes': ['error', 'single'],
138+
139+
// Require space before blocks
140+
'space-before-blocks': ['error', 'always'],
141+
142+
// Disallow a space before function parenthesis
143+
'space-before-function-paren': ['error', 'never'],
144+
145+
// Disallow spaces inside of parentheses
146+
'space-in-parens': 'error',
147+
148+
// Require spacing around infix operators
149+
'space-infix-ops': 'error',
150+
151+
// Enforce consistent spacing after the // or /* in a comment
152+
'spaced-comment': 'error',
153+
154+
// Require semicolon at the end of statement
155+
'semi': ['error', 'always'],
156+
157+
// Enforce spacing around colons of switch statements
158+
'switch-colon-spacing': [
159+
'error', { 'after': true, 'before': false }
160+
],
161+
162+
/*
163+
* ECMAScript 6
164+
*/
165+
166+
// Require parentheses around arrow function arguments
167+
'arrow-parens': 'error',
168+
'arrow-spacing': 'error',
169+
170+
// Require let or const instead of var
171+
'no-var': 'error',
172+
173+
// Require method and property shorthand syntax for object literals
174+
'object-shorthand': ['error', 'always'],
175+
176+
// Require `const` declarations for variables
177+
// that are never reassigned after declared
178+
'prefer-const': [
179+
'error', { 'destructuring': 'all' }
180+
],
181+
182+
// Require template literals instead of string concatenation
183+
'prefer-template': 'error',
184+
185+
// Disallow spacing around embedded expressions of template strings
186+
'template-curly-spacing': 'error',
187+
188+
/*
189+
* JSDoc plugin
190+
*/
191+
192+
'jsdoc/check-param-names': 'warn',
193+
'jsdoc/check-syntax': 'warn',
194+
'jsdoc/check-tag-names': 'warn',
195+
'jsdoc/check-types': [
196+
'warn', { 'noDefaults': true }
197+
],
198+
'jsdoc/no-undefined-types': 'warn',
199+
'jsdoc/require-param': 'warn',
200+
'jsdoc/require-param-description': 'warn',
201+
'jsdoc/require-param-name': 'warn',
202+
'jsdoc/require-param-type': 'warn',
203+
'jsdoc/require-returns-check': 'warn',
204+
'jsdoc/require-returns-description': 'warn',
205+
'jsdoc/require-returns-type': 'warn',
206+
'jsdoc/valid-types': 'warn',
207+
},
208+
'settings': {
209+
'jsdoc': {
210+
'tagNamePreference': {
211+
'class': 'constructor', 'returns': 'return'
212+
}
213+
},
214+
},
215+
};

0 commit comments

Comments
 (0)