Skip to content

Commit aee6e80

Browse files
add initialize eslint configuration (#1)
1 parent af94591 commit aee6e80

11 files changed

+281
-1
lines changed

.circleci/config.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
3+
jobs:
4+
build:
5+
docker:
6+
- image: circleci/node:9-browsers
7+
8+
steps:
9+
- checkout
10+
- run: npm install
11+
- run: npm run test

.editorconfig

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

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text eol=lf

.gitignore

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# NPM
2+
node_modules
3+
package-lock.json
4+
npm-debug.log
5+
6+
# OS generated files
7+
._*
8+
.DS_Store
9+
.Spotlight-V100
10+
.Trashes
11+
ehthumbs.db
12+
Thumbs.db
13+
14+
# IDEs
15+
.idea
16+
*.iml
17+
18+
# Changelog (generate with github_changelog_generator not commit just copied to release)
19+
CHANGELOG.md

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

README.md

+57-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,57 @@
1-
# eslint-config-ma
1+
# eslint-config-ma
2+
3+
![CircleCi](https://circleci.com/gh/massiveart/eslint-config-ma/tree/master.png)
4+
5+
Stylelint shareable config used by MASSIVE ART.
6+
7+
## Installation
8+
9+
To make use of this config, install this package as development dependency of your project:
10+
11+
```bash
12+
npm install eslint-config-ma --save-dev
13+
```
14+
15+
## Usage
16+
17+
Create a [`.eslintrc`](https://eslint.org/docs/user-guide/configuring) config file:
18+
19+
### .eslintrc
20+
21+
```js
22+
{
23+
"extends": "eslint-config-ma"
24+
}
25+
```
26+
27+
## Version Update & Publish to NPM
28+
29+
### 1. Create release on github
30+
31+
Update package.json version on master branch:
32+
33+
```bash
34+
git checkout master
35+
git pull origin master
36+
npm version [ major | minor | patch ] --no-git-tag-version
37+
git add .
38+
git commit -m "Release <version>"
39+
git push origin master
40+
```
41+
42+
Generate changelog:
43+
44+
```bash
45+
github_changelog_generator --future-release <version>
46+
```
47+
48+
Copy the text of the last release into and get new release.
49+
50+
### 2. Publish release
51+
52+
```
53+
git fetch --tags
54+
git checkout <version>
55+
npm publish
56+
```
57+

index.js

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
"use strict"
2+
3+
module.exports = {
4+
"env": {
5+
"browser": true,
6+
"node": false,
7+
"es6": true
8+
},
9+
"globals": {
10+
"require": true,
11+
"module": true
12+
},
13+
"extends": "eslint:recommended",
14+
"parserOptions": {
15+
"ecmaVersion": 6,
16+
"sourceType": "module"
17+
},
18+
"rules": {
19+
"indent": [
20+
"error",
21+
4,
22+
{
23+
"SwitchCase": 1
24+
}
25+
],
26+
"linebreak-style": [
27+
"error",
28+
"unix"
29+
],
30+
"quotes": [
31+
"error",
32+
"single"
33+
],
34+
"one-var": [
35+
"error",
36+
"never"
37+
],
38+
"operator-linebreak": [
39+
"error",
40+
"before"
41+
],
42+
"padded-blocks": [
43+
"error",
44+
"never"
45+
],
46+
"semi": [
47+
"error",
48+
"always"
49+
],
50+
"max-len": [
51+
"error",
52+
120
53+
],
54+
"max-statements-per-line": [
55+
"error",
56+
{
57+
"max": 1
58+
}
59+
],
60+
"no-multiple-empty-lines": [
61+
"error",
62+
{
63+
"max": 1
64+
}
65+
],
66+
"object-curly-spacing": [
67+
"error",
68+
"always"
69+
],
70+
"object-curly-newline": [
71+
"error",
72+
{
73+
"minProperties": 1
74+
}
75+
],
76+
"space-before-function-paren": [
77+
"error",
78+
"never"
79+
],
80+
"curly": "error",
81+
"eqeqeq": "error",
82+
"capitalized-comments": "error",
83+
"no-unused-expressions": "error",
84+
"no-useless-call": "error",
85+
"no-useless-concat": "error",
86+
"no-useless-escape": "error",
87+
"no-useless-return": "error",
88+
"vars-on-top": "error",
89+
"no-undef-init": "error",
90+
"no-undefined": "error",
91+
"no-use-before-define": "error",
92+
"callback-return": "error",
93+
"no-mixed-requires": "error",
94+
"array-bracket-spacing": "error",
95+
"block-spacing": "error",
96+
"brace-style": "error",
97+
"camelcase": "error",
98+
"comma-spacing": "error",
99+
"comma-style": "error",
100+
"comma-dangle": "error",
101+
"computed-property-spacing": "error",
102+
"eol-last": "error",
103+
"func-call-spacing": "error",
104+
"func-name-matching": "error",
105+
"key-spacing": "error",
106+
"keyword-spacing": "error",
107+
"lines-around-directive": "error",
108+
"new-cap": "error",
109+
"new-parens": "error",
110+
"newline-before-return": "error",
111+
"no-lonely-if": "error",
112+
"no-nested-ternary": "error",
113+
"no-trailing-spaces": "error",
114+
"no-underscore-dangle": "error",
115+
"no-unneeded-ternary": "error",
116+
"no-whitespace-before-property": "error",
117+
"object-property-newline": "error",
118+
"space-before-blocks": "error",
119+
"space-in-parens": "error",
120+
"space-infix-ops": "error",
121+
"space-unary-ops": "error",
122+
"spaced-comment": "error",
123+
"no-compare-neg-zero": "error",
124+
"no-negated-condition": "warn",
125+
"no-warning-comments": "warn",
126+
"global-require": "warn",
127+
"require-jsdoc": "warn"
128+
}
129+
}
130+

package.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "eslint-config-ma",
3+
"version": "1.0.0",
4+
"description": "ESLint shareable config used by MASSIVE ART",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "eslint test/*.js --config ./index.js"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/massiveart/eslint-config-ma.git"
12+
},
13+
"keywords": [
14+
"eslint",
15+
"eslintconfig",
16+
"massiveart"
17+
],
18+
"author": "MASSIVE ART Webservices GmbH",
19+
"license": "MIT",
20+
"bugs": {
21+
"url": "https://github.com/massiveart/eslint-config-ma/issues"
22+
},
23+
"homepage": "https://github.com/massiveart/eslint-config-ma#readme",
24+
"dependencies": {
25+
"eslint": "^4.19.1"
26+
},
27+
"peerDependencies": {
28+
"eslint": ">=4"
29+
}
30+
}

test/class.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default class Test {
2+
3+
}

test/import.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import test from 'test';
2+
3+
export default test;

test/indent.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Test function for indention.
3+
*
4+
* @return {string}
5+
*/
6+
export default function test() {
7+
let test = 'hello';
8+
9+
for (let i = 0; i < 5; i++) {
10+
++i;
11+
12+
test += test;
13+
}
14+
15+
return test;
16+
}

0 commit comments

Comments
 (0)