1.0.7 • Published 7 months ago

eslint-config-mahir v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Mahir ESLint Config

The ultimate ESLint shareable config. This config includes all of the ESLint rules that I use in my projects.

!Important This is a highly opinionated config. It's based on my personal preferences and the way I write code. I don't recommend using this config as is as I'll update it based on my preferences without any notice.

Installation

npm install --save-dev eslint eslint-config-mahir

Usage

Add in your eslint.config.js (for esm projects) or eslint.config.mjs

import common from 'eslint-config-mahir/common';
import node from 'eslint-config-mahir/node';
import module from 'eslint-config-mahir/module';
import typescript from 'eslint-config-mahir/typescript';
import jsx from 'eslint-config-mahir/jsx';
import react from 'eslint-config-mahir/react';
import next from 'eslint-config-mahir/next';
import mdx from 'eslint-config-mahir/mdx';
import edge from 'eslint-config-mahir/edge';
import jsdoc from 'eslint-config-mahir/jsdoc';
import tsdoc from 'eslint-config-mahir/tsdoc';
import native from 'eslint-config-mahir/native';

export default [
	...common,
	...node,
	...module,
	...typescript,
	...jsx,
	...react, // when using react, you can omit jsx as it's already included with react
	...next,
	...mdx,
	...edge,
	...jsdoc,
	...tsdoc, // when using tsdoc, you can omit jsdoc as it's already included with tsdoc
	...native, // when using native, you can omit react as it's already included with native
];

You can remove any of the configs you don't need.

Note:

For typescript users, typed linting is done via projectService. You can learn more about it from https://typescript-eslint.io/getting-started/typed-linting/#faqs and customize it as per your need.

/**
 * @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigArray}
 */
export default [
	...
	{
	languageOptions: {
		parserOptions: {
			projectService: {
				allowDefaultProject: [
					'files-outside-tsconfig.json',
				],
				defaultProject: 'tsconfig.json',
			},
			tsconfigRootDir: process.cwd(),
		},
	},
]

Warning: If you are using both mdx and typescript config, make sure add files to avoid conflicts

/**

  • @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigArray} / export default [ // ... other configs ...mdx.map((config) => ({ files: ['**/.mdx'], ...config, })), ...typescript.map((config) => ({ files: '/*.tsx', '/.ts', '**/.cjs', '/*.jsx', '/*.js', ...config, })), // ... other configs ]
## Configs

This package contains eslint config for

- `common` rules common for all configs
- `node` rules for nodejs projects
- `module` rules for esm projects
- `typescript` rules for typescript projects
- `jsx` rules for jsx/tsx projects
- `react` rules for react projects (this config contains all the `jsx` rules too)
- `native` rules for react native projects (this config contains all the `react` rules too)
- `next` rules for nextjs projects
- `mdx` rules for mdx projects
- `edge` rules for projects running in edge
- `jsdoc` jsdoc related config
- `tsdoc` tsdoc related config (this config contains all the `jsdoc` rules too)

## Contributors ✨

Thanks goes to these wonderful people:

<a href="https://github.com/imranbarbhuiya/eslint-config-mahir/graphs/contributors">
    <img src="https://contrib.rocks/image?repo=imranbarbhuiya/eslint-config-mahir" />
</a>
1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.0

8 months ago

1.0.0-beta-1

8 months ago

1.0.0-beta-2

8 months ago

1.0.0-beta-3

8 months ago

1.0.0-beta-4

8 months ago

1.0.0-beta-0

8 months ago

1.0.0-beta-5

8 months ago

1.0.0-beta-6

8 months ago

1.0.0-beta-7

8 months ago

1.0.0-beta-8

8 months ago

0.0.46

8 months ago

0.0.44

11 months ago

0.0.45

11 months ago

0.0.41

1 year ago

0.0.42

1 year ago

0.0.43

1 year ago

0.0.40

1 year ago

0.0.39

1 year ago

0.0.38

1 year ago

0.0.37

1 year ago

0.0.34

2 years ago

0.0.35

2 years ago

0.0.36

2 years ago

0.0.32

2 years ago

0.0.33

2 years ago

0.0.31-prettier

2 years ago

0.0.30

2 years ago

0.0.31

2 years ago

0.0.30-prettier

2 years ago

0.0.28

2 years ago

0.0.29

2 years ago

0.0.27

2 years ago

0.0.25

2 years ago

0.0.26

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.19

2 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.9

3 years ago

0.0.16

3 years ago

0.0.8

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago