Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No extraneous dependencies, also documentation improvements #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Install

This module is for advanced users looking for a shareable configuration across projects for ESLint.
This module is standard in all P'unk Avenue apostrophe projects. It provides warnings of potential bugs and errors in your code. It is recommended for developers of all skill levels working with Apostrophe.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApostropheCMS instead of "apostrophe"


In the project root directory run:

Expand All @@ -16,6 +16,30 @@ Also, add the following to `.eslintrc` in the root directory:
}
```

## Other
## Editors

If you're using Atom as your editor you can install the [ESLint plugin](https://atom.io/packages/linter-eslint), which provides an interface for ESLint and this configuration.
If you're using Atom as your editor you can install the [ESLint plugin](https://atom.io/packages/linter-eslint), which provides an interface for ESLint and this configuration. [VSCode has similar features](https://github.com/Microsoft/vscode-eslint), this plugin may be installed in your editor already.

## Running it manually

Once you have installed all of the required npm packages and added your `.eslintrc` file, you can manually run:

```
npx eslint .
```

Some warnings, such as those about whitespace, can be fixed automatically:

```
npx eslint . --fix
```

## Making it mandatory: adding eslint to your tests

You can add it to the `test` property in `package.json`, like this:

```
"test": "mocha && eslint .",
```

Then `npm test` will not pass unless eslint passes. Here we assume you also have `mocha` tests. But you could combine this with any test command, or have it as the only test command. `&&` means "do not continue unless the previous command succeeded."
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = {
'rules': {
'semi': ['error', 'always'],
'no-unused-vars': ['error', { 'varsIgnorePattern': 'apos', 'args': 'none', 'ignoreRestSiblings': true }],
'import/no-extraneous-dependencies': 1,
'no-var': 'error'
}
};