-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add initialize eslint configuration (#1)
- Loading branch information
1 parent
af94591
commit aee6e80
Showing
11 changed files
with
281 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: 2 | ||
|
||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/node:9-browsers | ||
|
||
steps: | ||
- checkout | ||
- run: npm install | ||
- run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# NPM | ||
node_modules | ||
package-lock.json | ||
npm-debug.log | ||
|
||
# OS generated files | ||
._* | ||
.DS_Store | ||
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db | ||
|
||
# IDEs | ||
.idea | ||
*.iml | ||
|
||
# Changelog (generate with github_changelog_generator not commit just copied to release) | ||
CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,57 @@ | ||
# eslint-config-ma | ||
# eslint-config-ma | ||
|
||
![CircleCi](https://circleci.com/gh/massiveart/eslint-config-ma/tree/master.png) | ||
|
||
Stylelint shareable config used by MASSIVE ART. | ||
|
||
## Installation | ||
|
||
To make use of this config, install this package as development dependency of your project: | ||
|
||
```bash | ||
npm install eslint-config-ma --save-dev | ||
``` | ||
|
||
## Usage | ||
|
||
Create a [`.eslintrc`](https://eslint.org/docs/user-guide/configuring) config file: | ||
|
||
### .eslintrc | ||
|
||
```js | ||
{ | ||
"extends": "eslint-config-ma" | ||
} | ||
``` | ||
|
||
## Version Update & Publish to NPM | ||
|
||
### 1. Create release on github | ||
|
||
Update package.json version on master branch: | ||
|
||
```bash | ||
git checkout master | ||
git pull origin master | ||
npm version [ major | minor | patch ] --no-git-tag-version | ||
git add . | ||
git commit -m "Release <version>" | ||
git push origin master | ||
``` | ||
|
||
Generate changelog: | ||
|
||
```bash | ||
github_changelog_generator --future-release <version> | ||
``` | ||
|
||
Copy the text of the last release into and get new release. | ||
|
||
### 2. Publish release | ||
|
||
``` | ||
git fetch --tags | ||
git checkout <version> | ||
npm publish | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
"use strict" | ||
|
||
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"node": false, | ||
"es6": true | ||
}, | ||
"globals": { | ||
"require": true, | ||
"module": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"indent": [ | ||
"error", | ||
4, | ||
{ | ||
"SwitchCase": 1 | ||
} | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"quotes": [ | ||
"error", | ||
"single" | ||
], | ||
"one-var": [ | ||
"error", | ||
"never" | ||
], | ||
"operator-linebreak": [ | ||
"error", | ||
"before" | ||
], | ||
"padded-blocks": [ | ||
"error", | ||
"never" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
"max-len": [ | ||
"error", | ||
120 | ||
], | ||
"max-statements-per-line": [ | ||
"error", | ||
{ | ||
"max": 1 | ||
} | ||
], | ||
"no-multiple-empty-lines": [ | ||
"error", | ||
{ | ||
"max": 1 | ||
} | ||
], | ||
"object-curly-spacing": [ | ||
"error", | ||
"always" | ||
], | ||
"object-curly-newline": [ | ||
"error", | ||
{ | ||
"minProperties": 1 | ||
} | ||
], | ||
"space-before-function-paren": [ | ||
"error", | ||
"never" | ||
], | ||
"curly": "error", | ||
"eqeqeq": "error", | ||
"capitalized-comments": "error", | ||
"no-unused-expressions": "error", | ||
"no-useless-call": "error", | ||
"no-useless-concat": "error", | ||
"no-useless-escape": "error", | ||
"no-useless-return": "error", | ||
"vars-on-top": "error", | ||
"no-undef-init": "error", | ||
"no-undefined": "error", | ||
"no-use-before-define": "error", | ||
"callback-return": "error", | ||
"no-mixed-requires": "error", | ||
"array-bracket-spacing": "error", | ||
"block-spacing": "error", | ||
"brace-style": "error", | ||
"camelcase": "error", | ||
"comma-spacing": "error", | ||
"comma-style": "error", | ||
"comma-dangle": "error", | ||
"computed-property-spacing": "error", | ||
"eol-last": "error", | ||
"func-call-spacing": "error", | ||
"func-name-matching": "error", | ||
"key-spacing": "error", | ||
"keyword-spacing": "error", | ||
"lines-around-directive": "error", | ||
"new-cap": "error", | ||
"new-parens": "error", | ||
"newline-before-return": "error", | ||
"no-lonely-if": "error", | ||
"no-nested-ternary": "error", | ||
"no-trailing-spaces": "error", | ||
"no-underscore-dangle": "error", | ||
"no-unneeded-ternary": "error", | ||
"no-whitespace-before-property": "error", | ||
"object-property-newline": "error", | ||
"space-before-blocks": "error", | ||
"space-in-parens": "error", | ||
"space-infix-ops": "error", | ||
"space-unary-ops": "error", | ||
"spaced-comment": "error", | ||
"no-compare-neg-zero": "error", | ||
"no-negated-condition": "warn", | ||
"no-warning-comments": "warn", | ||
"global-require": "warn", | ||
"require-jsdoc": "warn" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "eslint-config-ma", | ||
"version": "1.0.0", | ||
"description": "ESLint shareable config used by MASSIVE ART", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "eslint test/*.js --config ./index.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/massiveart/eslint-config-ma.git" | ||
}, | ||
"keywords": [ | ||
"eslint", | ||
"eslintconfig", | ||
"massiveart" | ||
], | ||
"author": "MASSIVE ART Webservices GmbH", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/massiveart/eslint-config-ma/issues" | ||
}, | ||
"homepage": "https://github.com/massiveart/eslint-config-ma#readme", | ||
"dependencies": { | ||
"eslint": "^4.19.1" | ||
}, | ||
"peerDependencies": { | ||
"eslint": ">=4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default class Test { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import test from 'test'; | ||
|
||
export default test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Test function for indention. | ||
* | ||
* @return {string} | ||
*/ | ||
export default function test() { | ||
let test = 'hello'; | ||
|
||
for (let i = 0; i < 5; i++) { | ||
++i; | ||
|
||
test += test; | ||
} | ||
|
||
return test; | ||
} |