Skip to content

Commit

Permalink
add initialize eslint configuration (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz authored Apr 17, 2018
1 parent af94591 commit aee6e80
Show file tree
Hide file tree
Showing 11 changed files with 281 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .circleci/config.yml
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
10 changes: 10 additions & 0 deletions .editorconfig
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
19 changes: 19 additions & 0 deletions .gitignore
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
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
58 changes: 57 additions & 1 deletion README.md
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
```

130 changes: 130 additions & 0 deletions index.js
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"
}
}

30 changes: 30 additions & 0 deletions package.json
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"
}
}
3 changes: 3 additions & 0 deletions test/class.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default class Test {

}
3 changes: 3 additions & 0 deletions test/import.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import test from 'test';

export default test;
16 changes: 16 additions & 0 deletions test/indent.js
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;
}

0 comments on commit aee6e80

Please sign in to comment.