-
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
0 parents
commit f53a7b7
Showing
10 changed files
with
243 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,18 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
max_line_length = 80 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
max_line_length = 0 | ||
trim_trailing_whitespace = false | ||
|
||
[COMMIT_EDITMSG] | ||
max_line_length = 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,3 @@ | ||
{ | ||
"extends": "./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 @@ | ||
* text=auto |
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,49 @@ | ||
# OS X | ||
.DS_Store* | ||
Icon? | ||
._* | ||
|
||
# Windows | ||
Thumbs.db | ||
ehthumbs.db | ||
Desktop.ini | ||
|
||
# Linux | ||
.directory | ||
*~ | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
*.gz | ||
|
||
# Sauce Labs credentials | ||
sauce.json |
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,6 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- '6.0' | ||
- node | ||
script: npm 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,22 @@ | ||
Open Source Initiative OSI - The MIT License | ||
|
||
Copyright (c) 2016-2017 Thomas Prelot | ||
|
||
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,50 @@ | ||
# @gnodi/lint | ||
|
||
[Node.js] Lint your code like gnodi ! | ||
|
||
[![Build Status][travis-image]][travis-url] | ||
|
||
## Installation | ||
|
||
Run the following command to add the package to your dev dependencies: | ||
```sh | ||
$ npm install --save-dev @gnodi/eslint-config | ||
``` | ||
|
||
## Use | ||
|
||
### Use gnodi lint helper script | ||
|
||
Add the following line to your `package.json`: | ||
```json | ||
... | ||
"scripts": { | ||
... | ||
"lint": "gnodi-lint" | ||
} | ||
... | ||
``` | ||
|
||
Then, you can immediately run the lint: | ||
```sh | ||
$ npm run lint | ||
``` | ||
|
||
### Override with custom rules | ||
|
||
You can override some [rules](http://eslint.org/docs/rules/) with your own ones just using a standard `.eslintrc`: | ||
```json | ||
{ | ||
"extends": "@gnodi", | ||
"rules": { | ||
"comma-dangle": ["error", "always"] | ||
} | ||
} | ||
``` | ||
|
||
### LICENSE | ||
|
||
[MIT](LICENSE) | ||
|
||
[travis-image]: https://img.shields.io/travis/gnodi/eslint-config.svg?style=flat | ||
[travis-url]: https://travis-ci.org/gnodi/eslint-config |
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,41 @@ | ||
#! /usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
const spawn = require('child_process').spawn; | ||
|
||
const cwd = process.cwd(); | ||
let configFilePath = path.join(cwd, '.eslintrc'); | ||
|
||
try { | ||
fs.accessSync(configFilePath); | ||
} catch (error) { | ||
configFilePath = path.join(__dirname, '..', '.eslintrc'); | ||
} | ||
|
||
/** | ||
* @todo think about using ignore file on eslint v4 release | ||
* @see https://github.com/eslint/eslint/issues/6759 | ||
*/ | ||
const rootPath = path.join(cwd, '*.js'); | ||
const binPath = path.join(cwd, 'bin'); | ||
const configPath = path.join(cwd, 'config'); | ||
const libPath = path.join(cwd, 'lib'); | ||
const srcPath = path.join(cwd, 'src'); | ||
const testPath = path.join(cwd, 'test'); | ||
|
||
spawn( | ||
'npm', | ||
[ | ||
'run', 'lint', '--', | ||
'--color', | ||
'--config', configFilePath, | ||
rootPath, binPath, configPath, libPath, srcPath, testPath | ||
], | ||
{ | ||
cwd: path.join(__dirname, '..'), | ||
stdio: 'inherit' | ||
} | ||
); |
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,15 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
extends: 'airbnb-base', | ||
env: { | ||
browser: true, | ||
node: true | ||
}, | ||
parserOptions: { | ||
sourceType: 'script' | ||
}, | ||
rules: { | ||
'comma-dangle': ['error', 'never'] | ||
} | ||
}; |
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,38 @@ | ||
{ | ||
"name": "@gnodi/eslint-config", | ||
"description": "[Node.js] Lint your code like gnodi's one", | ||
"version": "0.0.0", | ||
"author": "Thomas Prelot <[email protected]> (https://github.com/Gnucki)", | ||
"contributors": [], | ||
"keywords": [ | ||
"gnodi", | ||
"lint", | ||
"eslint" | ||
], | ||
"dependencies": { | ||
"eslint": "^3.8.1", | ||
"eslint-config-airbnb-base": "^9.0.0", | ||
"eslint-config-standard": "^6.2.0", | ||
"eslint-plugin-import": "^2.0.1", | ||
"eslint-plugin-promise": "^3.3.0", | ||
"eslint-plugin-standard": "^2.0.1" | ||
}, | ||
"devDependencies": {}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/gnodi/eslint-config" | ||
}, | ||
"main": "index", | ||
"scripts": { | ||
"lint": "eslint", | ||
"test": "eslint **/*.js" | ||
}, | ||
"bin": { | ||
"gnodi-lint": "bin/gnodi-lint.js" | ||
}, | ||
"engines": { | ||
"node": ">=6", | ||
"npm": ">=3" | ||
} | ||
} |