-
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.
Merge pull request #2 from duckduckgo:prettier-tweaks
Changes to support Prettier
- Loading branch information
Showing
4 changed files
with
54 additions
and
36 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,38 @@ | ||
# DDG shared eslint configuration | ||
|
||
This is a shared eslint configuration used across several DDG projects. | ||
|
||
## How to set up your project with this config | ||
|
||
- This config is meant to be used with ESLint 9+ AND Prettier, so make sure you are using those in your project. | ||
- add a dev NPM dependency: `github:duckduckgo/eslint-config#<GIT_COMMIT_OR_TAG>` | ||
- in your `eslint.config.js`, import this config and put it in the configuration array. You probably want it after other "recommended" configs, and before project-specific rules. | ||
|
||
```js | ||
import someConfig from "some-other-config-you-use"; | ||
import ddgConfig from '@duckduckgo/eslint-config' | ||
export default [ | ||
someConfig, | ||
...ddgConfig, | ||
{ | ||
rules: { | ||
// your project-specific rules here | ||
}, | ||
} | ||
]; | ||
``` | ||
|
||
## Prettier is required | ||
This config disables ESLint formatting rules (through `eslint-config-prettier`), so you are expected to rely on Prettier to do the formatting. Make sure you have Prettier set up in your project. | ||
|
||
## ESLint plugins | ||
This config **already includes** the following plugins, so you don't need to install them explicitly: | ||
- `eslint-plugin-n` | ||
- `eslint-plugin-import` | ||
- `eslint-plugin-promise` | ||
- `eslint-config-prettier` | ||
|
||
It also includes **recommended** configuration from `@eslint/js` (but not for other plugins). | ||
|
||
## TypeScript | ||
This config does not include TypeScript-specific rules, and does not depend on `typescript-eslint`. The reason for that is that typescript plugin disables some standard JS rules, and this would mess things up for pure-JS projects. If you are using TypeScript, you can add `typescript-eslint` to your project and configure it separately. You can check existing DDG projects for examples. |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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