Skip to content

Commit

Permalink
Add project files
Browse files Browse the repository at this point in the history
  • Loading branch information
alexesprit committed Apr 12, 2020
1 parent 11af39f commit 820a021
Show file tree
Hide file tree
Showing 7 changed files with 1,461 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[{*.json,*.yml,*.yaml}]
indent_size = 2
indent_style = space
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Web Scrobbler Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# eslint-config-web-scrobbler

ESLint configuration file for Web Scrobbler projects.

## Usage

You can install `eslint-config-web-scrobbler` by a following way:
```sh
> npm install --save-dev eslint-config-web-scrobbler
```

Then, add `eslint-config-web-scrobbler` to the `extends` array in your
`.eslintrc.*` file.
```json
{
"extends": [
"some-other-config-you-use",
"web-scrobbler"
]
}
```

## License

Licensed under the [MIT License](./LICENSE)
215 changes: 215 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
'use strict';

module.exports = {
'env': {
'es6': true,
'node': true,
},
'extends': [
'eslint:recommended'
],
'plugins': [
'jsdoc'
],
'rules': {
/*
* Possible errors
*/

// Enforce "for" loop update clause moving the counter
// in the right direction
'for-direction': 'error',

// Disallow unnecessary parentheses
'no-extra-parens': 'error',

// Disallow template literal placeholder syntax in regular string
'no-template-curly-in-string': 'error',

/*
* Best practices
*/

// Enforce consistent brace style for all control statements
'curly': 'error',

// Require the use of === and !==
'eqeqeq': 'error',

// Disallow `else` blocks after `return` statements in `if` statements
'no-else-return': 'error',

// Disallow empty functions
'no-empty-function': 'error',

// Disallow function declarations and expressions inside loop statements
'no-loop-func': 'error',

// Disallow new operators with the String, Number, and Boolean objects
'no-new-wrappers': 'error',

// Disallow reassigning function parameters
'no-param-reassign': 'error',

// Disallow unnecessary concatenation of strings
'no-useless-concat': 'error',

// Disallow redundant return statements
'no-useless-return': 'error',

/*
* Strict mode
*/

// Require global strict mode directive
'strict': ['error', 'global'],

/*
* Stylistic issues
*/

// Require 'one true brace style', in which the opening brace
// of a block is placed on the same line as its corresponding
// statement or declaration
'brace-style': ['error', '1tbs'],

// Disallow spaces inside of brackets
'array-bracket-spacing': ['error', 'never'],

// Require CamelCase
'camelcase': ['error', { 'properties': 'never' }],

// Require space after comma
'comma-spacing': ['error', { 'after': true }],

// Require newline at the end of files
'eol-last': ['error', 'always'],

// Disallow spacing between function identifiers and their invocations
'func-call-spacing': 'error',

// Use tabs as indentation
// Enforce indentation level for case clauses in switch statements
'indent': [
'error', 'tab', { 'SwitchCase': 1 }
],

// Require space after colon in object literal properties
'key-spacing': [
'error', { 'afterColon': true }
],

// Require space before and after keywords
'keyword-spacing': 'error',

// Require Unix line endings
'linebreak-style': ['error', 'unix'],

// Disallow empty block statements
'no-empty': [
'error', { 'allowEmptyCatch': true }
],

// Disallow `if` statements as the only statement in `else` blocks
'no-lonely-if': 'error',

// Disallow multiple spaces
'no-multi-spaces': 'error',

// Disallow nested ternary expressions
'no-nested-ternary': 'error',

// Disallow trailing whitespace at the end of lines
'no-trailing-spaces': 'error',

// Disallow ternary operators when simpler alternatives exist
'no-unneeded-ternary': 'error',

// Disallow whitespace before properties
'no-whitespace-before-property': 'error',

'one-var': ['error', 'never'],

// Require spaces inside curly braces
'object-curly-spacing': ['error', 'always'],

// Require single quotes
'quotes': ['error', 'single'],

// Require space before blocks
'space-before-blocks': ['error', 'always'],

// Disallow a space before function parenthesis
'space-before-function-paren': ['error', 'never'],

// Disallow spaces inside of parentheses
'space-in-parens': 'error',

// Require spacing around infix operators
'space-infix-ops': 'error',

// Enforce consistent spacing after the // or /* in a comment
'spaced-comment': 'error',

// Require semicolon at the end of statement
'semi': ['error', 'always'],

// Enforce spacing around colons of switch statements
'switch-colon-spacing': [
'error', { 'after': true, 'before': false }
],

/*
* ECMAScript 6
*/

// Require parentheses around arrow function arguments
'arrow-parens': 'error',
'arrow-spacing': 'error',

// Require let or const instead of var
'no-var': 'error',

// Require method and property shorthand syntax for object literals
'object-shorthand': ['error', 'always'],

// Require `const` declarations for variables
// that are never reassigned after declared
'prefer-const': [
'error', { 'destructuring': 'all' }
],

// Require template literals instead of string concatenation
'prefer-template': 'error',

// Disallow spacing around embedded expressions of template strings
'template-curly-spacing': 'error',

/*
* JSDoc plugin
*/

'jsdoc/check-param-names': 'warn',
'jsdoc/check-syntax': 'warn',
'jsdoc/check-tag-names': 'warn',
'jsdoc/check-types': [
'warn', { 'noDefaults': true }
],
'jsdoc/no-undefined-types': 'warn',
'jsdoc/require-param': 'warn',
'jsdoc/require-param-description': 'warn',
'jsdoc/require-param-name': 'warn',
'jsdoc/require-param-type': 'warn',
'jsdoc/require-returns-check': 'warn',
'jsdoc/require-returns-description': 'warn',
'jsdoc/require-returns-type': 'warn',
'jsdoc/valid-types': 'warn',
},
'settings': {
'jsdoc': {
'tagNamePreference': {
'class': 'constructor', 'returns': 'return'
}
},
},
};
Loading

0 comments on commit 820a021

Please sign in to comment.