https://github.com/apify/apify-eslint-config
Apify ESLint preset to be shared between projects
https://github.com/apify/apify-eslint-config
Last synced: 4 months ago
JSON representation
Apify ESLint preset to be shared between projects
- Host: GitHub
- URL: https://github.com/apify/apify-eslint-config
- Owner: apify
- License: apache-2.0
- Created: 2019-02-18T10:57:42.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-03-28T13:54:42.000Z (12 months ago)
- Last Synced: 2025-04-11T22:11:25.816Z (11 months ago)
- Language: JavaScript
- Size: 60.5 KB
- Stars: 3
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# apify-eslint-config
This repository contains a shared eslint config used across [Apify](https://apify.com/). It offers several configs:
- JavaScript config `@apify/eslint-config/js`
- [TypeScript](https://www.npmjs.com/package/typescript) config that also includes JavaScript config `@apify/eslint-config/ts`
- [Jest](https://www.npmjs.com/package/jest) config that only applies to test files and folders `@apify/eslint-config/jest`
## How to add to your project
First install the packages as development dependencies:
```bash
npm install --save-dev @apify/eslint-config eslint
```
Optionally, you can install `typescript-eslint` or `eslint-plugin-jest` if you intend to use [TypeScript](https://www.npmjs.com/package/typescript) or [Jest](https://www.npmjs.com/package/jest).
Add `eslint.config.js` file, here's an example configuration for a TypeScript project using ESM and Jest for tests:
```js
import apifyTypescriptConfig from '@apify/eslint-config/ts';
// Optional
import apifyJestConfig from '@apify/eslint-config/jest';
export default [
...apifyTypescriptConfig,
...apifyJestConfig,
{
languageOptions: {
sourceType: 'module',
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
];
```
An example configuration for a JavaScript project using CommonJS without Jest:
```js
const apifyJsConfig = require('@apify/eslint-config/js');
module.exports = [
...apifyJsConfig,
];
```