This repository has been archived by the owner on Oct 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kevin Ruff
committed
Feb 15, 2018
0 parents
commit 9903c9d
Showing
10 changed files
with
3,275 additions
and
0 deletions.
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,9 @@ | ||
{ | ||
"env": { | ||
"node": true, | ||
"es6": true, | ||
"jest/globals": true | ||
}, | ||
"plugins": ["jest"], | ||
"extends": "./src/index.js" | ||
} |
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,2 @@ | ||
node_modules | ||
coverage |
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 @@ | ||
v8 |
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,17 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- "8" | ||
cache: | ||
directories: | ||
- node_modules | ||
notifications: | ||
email: false | ||
install: | ||
- yarn install | ||
script: | ||
- yarn lint | ||
- yarn test --coverage | ||
branches: | ||
except: | ||
- /^v\d+\.\d+\.\d+$/ |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Immowelt Hamburg | ||
|
||
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. |
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 @@ | ||
# @immowelt/eslint-config-immowelt-es5 | ||
|
||
[![Powered by Immowelt](https://img.shields.io/badge/powered%20by-immowelt-yellow.svg?colorB=ffb200)](https://stackshare.io/immowelt-group/) | ||
[![Build Status](https://travis-ci.org/ImmoweltGroup/eslint-config-immowelt-es5.svg?branch=master)](https://travis-ci.org/ImmoweltGroup/eslint-config-immowelt-es5) | ||
[![Dependency Status](https://david-dm.org/ImmoweltGroup/eslint-config-immowelt-es5.svg)](https://david-dm.org/ImmoweltGroup/eslint-config-immowelt-es5) | ||
[![devDependency Status](https://david-dm.org/ImmoweltGroup/eslint-config-immowelt-es5/dev-status.svg)](https://david-dm.org/ImmoweltGroup/eslint-config-immowelt-es5#info=devDependencies&view=table) | ||
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovateapp.com/) | ||
|
||
This package servers as the basis for the JavaScript standards of the Immowelt GmbH. | ||
|
||
It sets a bunch of rules and warnings for best practices on how to write a maintainable JavaScript code base, as well as hints on how to write a good performing es5 application. | ||
|
||
## Usage | ||
|
||
If you want to use the `@immowelt/eslint-config-immowelt-es5` config, you can install it by executing: | ||
|
||
```bash | ||
npm i -D @immowelt/eslint-config-immowelt-es5 | ||
``` | ||
|
||
Then create a file named `.eslintrc` with following contents in the root folder of your project: | ||
|
||
```json | ||
{ | ||
"extends": "@immowelt/eslint-config-immowelt-es5" | ||
} | ||
``` | ||
|
||
## Licensing | ||
See the `LICENSE` file at the root of the repository. |
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,31 @@ | ||
{ | ||
"name": "eslint-config-immowelt-es5", | ||
"version": "0.0.0", | ||
"description": "JavaScript Standard Style For Immowelt ES5 Projects - ESLint Shareable Config", | ||
"main": "index.js", | ||
"author": "Immonet dev team <aegaeon@immonet.de> (https://www.immowelt.de)", | ||
"license": "MIT", | ||
"homepage": "https://github.com/ImmoweltGroup/eslint-config-immowelt-es5#readme", | ||
"bugs": { | ||
"url": "https://github.com/ImmoweltGroup/eslint-config-immowelt-es5/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ImmoweltGroup/eslint-config-immowelt-es5.git" | ||
}, | ||
"keywords": [ | ||
"eslint", | ||
"immowelt", | ||
"config", | ||
"immonet" | ||
], | ||
"scripts": { | ||
"lint": "eslint \"src/**/*.js\"", | ||
"test": "jest" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^4.17.0", | ||
"eslint-plugin-jest": "^21.12.1", | ||
"jest": "^22.3.0" | ||
} | ||
} |
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,72 @@ | ||
module.exports = { | ||
extends: 'eslint:recommended', | ||
env: { | ||
browser: true, | ||
jquery: true | ||
}, | ||
globals: { | ||
'enquire': true, | ||
'dataLayer': true, | ||
'_gaq': true, | ||
'TINY': true, | ||
'trackSearchAgent': true | ||
}, | ||
rules: { | ||
'array-bracket-spacing': 'error', | ||
'brace-style': 'error', | ||
'comma-style': 'error', | ||
'dot-notation': 'error', | ||
'eol-last': 'error', | ||
'eqeqeq': [ | ||
'error', | ||
'smart' | ||
], | ||
'indent': [ | ||
'error', | ||
2 | ||
], | ||
'keyword-spacing': 'error', | ||
'linebreak-style': 'error', | ||
'newline-per-chained-call': 'error', | ||
'no-array-constructor': 'error', | ||
'no-console': [ | ||
'error', | ||
{ | ||
'allow': [ | ||
'error', | ||
'warn' | ||
] | ||
} | ||
], | ||
'no-dupe-class-members': 'error', | ||
'no-else-return': 'error', | ||
'no-eval': 'error', | ||
'no-loop-func': 'error', | ||
'no-mixed-operators': 'error', | ||
'no-nested-ternary': 'error', | ||
'no-new-func': 'error', | ||
'no-new-object': 'error', | ||
'no-new-wrappers': 'error', | ||
'no-unneeded-ternary': 'error', | ||
'nonblock-statement-body-position': 'error', | ||
'object-curly-spacing': 'error', | ||
'padded-blocks': [ | ||
'error', | ||
'never' | ||
], | ||
'quote-props': [ | ||
'error', | ||
'consistent' | ||
], | ||
'quotes': [ | ||
'error', | ||
'single' | ||
], | ||
'semi': 'error', | ||
'space-before-blocks': 'error', | ||
'space-before-function-paren': 'error', | ||
'space-in-parens': 'error', | ||
'space-infix-ops': 'error', | ||
'spaced-comment': 'error' | ||
} | ||
}; |
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,22 @@ | ||
const {linter} = require('eslint'); | ||
const config = require('./index.js'); | ||
|
||
const runEslint = str => linter.verify(str, config, {filename: 'foo.js'}); | ||
|
||
describe('eslint-config-immowelt-es5', () => { | ||
it('should export a valid eslint config object structure.', () => { | ||
expect(typeof config).toBe('object'); | ||
}); | ||
|
||
it('should not throw errors when checking a valid code fixture.', () => { | ||
const errors = runEslint(`var x = true; | ||
if (x) { | ||
console.warn('warning'); | ||
} | ||
`); | ||
|
||
expect(errors).toEqual([]); | ||
}); | ||
}); |
Oops, something went wrong.