-
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.
- Loading branch information
1 parent
1c4c60a
commit d6dd004
Showing
3 changed files
with
103 additions
and
3 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,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2018 Brandon Kalinowski | ||
|
||
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,76 @@ | ||
# Gatsby Standard - ESLint Config | ||
|
||
[](https://standardjs.com) [](https://www.npmjs.com/package/eslint-config-gatsby-standard) | ||
|
||
ESLint rule configuration for Gatsby Sites. This rule set is designed to closely match the Gatsby Starters while still following StandardJS. Simply install and extend to clean up your GatsbyJS code! The plugins and parser used are dependencies of this project. No need to specify them separately in your project. | ||
|
||
This config is designed to be used in conjunction with prettier for automatic code formatting. Conflicting rules have been disabled through `eslint-config-prettier`. See the "Use With Atom" section below for a suggestion on how to implement this config with prettier for automatic linting and formatting. | ||
|
||
## Usage | ||
|
||
Install the configs by running: | ||
|
||
```sh | ||
npm install --save-dev eslint eslint-config-gatsby-standard | ||
``` | ||
|
||
Then simply create a `.eslintrc.json` at your project root: | ||
|
||
```json | ||
{ | ||
"extends": "gatsby-standard" | ||
} | ||
``` | ||
|
||
Be sure you also have an `.eslintignore` file in your project root so you won't receive unnecessary lint errors from Gatsby: | ||
|
||
``` | ||
public | ||
static | ||
.cache | ||
content | ||
``` | ||
|
||
## Plugins Used: | ||
|
||
* [eslint-config-standard](https://www.npmjs.com/package/eslint-config-standard) | ||
* [eslint-plugin-standard](https://www.npmjs.com/package/eslint-plugin-standard) | ||
* [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) | ||
* [eslint-config-standard-react](https://www.npmjs.com/package/eslint-config-standard-react) | ||
* [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import) | ||
* [eslint-plugin-node](https://www.npmjs.com/package/eslint-plugin-node) | ||
* [eslint-plugin-promise](https://www.npmjs.com/package/eslint-plugin-promise) | ||
* [eslint-config-prettier](https://www.npmjs.com/package/eslint-config-prettier) | ||
|
||
## Use With Atom | ||
|
||
To use with prettier just add the `.prettierrc.json` config file to the root of the project: | ||
|
||
```json | ||
{ | ||
"printWidth": 100, | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
} | ||
``` | ||
|
||
If you use Atom, you can install linter-eslint to view the results of Gatsby Standard immediately. | ||
|
||
``` | ||
apm install linter-eslint | ||
``` | ||
|
||
Disable "Fix errors on save" and install prettier-atom: | ||
|
||
``` | ||
apm install prettier-atom | ||
``` | ||
|
||
Choose "ESLint Integration" in the package settings. This will use a global install of prettier-eslint but it will still follow the Gatsby Standard linting rules. | ||
|
||
Be sure to check "Run Prettier Last" and optionally "Format Files on Save" and "Show in Status Bar." Most other code editors have similar packages to format on demand. | ||
|
||
## License | ||
|
||
MIT (c) 2018 Brandon Kalinowski |
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,7 +1,8 @@ | ||
{ | ||
"name": "eslint-config-gatsby-standard", | ||
"version": "1.0.0", | ||
"description": "Yet Another ESLint Config. This one installs rules required to use standardJS", | ||
"description": | ||
"Yet Another ESLint Config. This one installs rules required to use standardJS with Gatsby projects", | ||
"main": ".eslintrc.json", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
|
@@ -24,9 +25,11 @@ | |
"style", | ||
"eslintconfig", | ||
"standard", | ||
"style" | ||
"style", | ||
"GatsbyJS", | ||
"eslint" | ||
], | ||
"author": "Brandon Kalinowski <[email protected]>", | ||
"author": "Brandon Kalinowski", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/brandonkal/eslint-config-gatsby-standard/issues" | ||
|