Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/100terres/easelint
A modern ESlint configuration for JavaScript, TypeScript and React that includes the Airbnb style guide, jsx-a11y to help with accessibility and Prettier to do some code formatting.
https://github.com/100terres/easelint
airbnb-eslint eslint javascript prettier react typescript
Last synced: 15 days ago
JSON representation
A modern ESlint configuration for JavaScript, TypeScript and React that includes the Airbnb style guide, jsx-a11y to help with accessibility and Prettier to do some code formatting.
- Host: GitHub
- URL: https://github.com/100terres/easelint
- Owner: 100terres
- License: mit
- Created: 2022-10-16T04:10:03.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-03T04:21:04.000Z (over 1 year ago)
- Last Synced: 2024-10-13T01:47:46.215Z (3 months ago)
- Topics: airbnb-eslint, eslint, javascript, prettier, react, typescript
- Language: JavaScript
- Homepage:
- Size: 377 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
easelint
A modern ESlint configuration for JavaScript, TypeScript and React that includes the Airbnb style guide, jsx-a11y to help with accessibility and Prettier to do some code formatting.## A bit of context
It's always a bit time consuming to create or maintain different [ESlint](https://eslint.org/) configurations that work with different languages and libraries such as [TypeScript](https://www.typescriptlang.org/) and [React](https://reactjs.org/). The goal of this package is to have different configurations that just work out-of-the-box and are constantly kept up-to-date.
## Getting Started 🚀
Installing this package is as easy as any other packages. Simply use your favorite package manager. Keep in mind you'll need to install the required peer dependencies first.
### Install ESlint and Prettier peer dependencies
Install [ESlint](https://eslint.org/) and [Prettier](https://prettier.io/) either locally or globally. Note that locally per project is strongly preferred.
```sh
npm install eslint@8 --save-dev
npm install prettier@2 --save-dev --save-exact
```If you use [TypeScript](https://www.typescriptlang.org/) or [React](https://reactjs.org/) you'll also need to install them, but let's assume they're already installed. We'll only support most recent versions. Have a look at the `peerDependencies` field in the `package.json` file to know which versions are supported.
### Install easelint
```sh
npm install easelint --save-dev
```### Setup the configuration file
Using any [file formats](https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats) supported by [ESlint](https://eslint.org/), you'll need to add `"100terres"` in the `"extends"` value of the configuration. Here's an example using a `.eslintrc.js` file.
#### Using the full configuration with JavaScript, TypeScript and React
```js
const easelint = require("easelint");module.exports = easelint({
javascript: true,
typescript: true,// we currently only support React
jsxPragma: "react",eslint: {
// any eslint configuration e.g.
overrides: [
{
files: ["vite.config.ts"],
rules: {
"import/no-extraneous-dependencies": "off",
},
},
],
},
});```
Voilà! Your project now uses a linter.
## How to Contribute 🤝
Pull requests are welcomed. If you'd like to contribute to `easelint`, that's awesome. Simply open an issue explaining what should be changed, improved or fixed. If we decide that a change is required, we can open a pull request. Once everything looks good, I'll approve and merge the PR.
## License
Licensed under the [MIT license](LICENSE).