Skip to content

Commit

Permalink
Merge branch 'main' into changeset-release/main
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Dec 20, 2022
2 parents 3a94d08 + ffaacaa commit 8dc1ded
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 56 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-squids-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mheob/eslint-config': major
---

add `eslint-plugin-simple-import-sort` and `eslint-plugin-import` ESLint plugins
7 changes: 5 additions & 2 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,15 @@
"sort-package-json": "pnpm dlx sort-package-json"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"eslint-config-next": "^13.0.7",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-simple-import-sort": "^8.0.0",
"eslint-plugin-unicorn": "^45.0.2"
},
"devDependencies": {
Expand Down
38 changes: 36 additions & 2 deletions packages/eslint-config/src/base.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,47 @@
import type { Linter } from 'eslint';

const config: Linter.Config = {
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:unicorn/recommended', 'plugin:prettier/recommended'],
plugins: ['@typescript-eslint', 'simple-import-sort'],
extends: [
'eslint:recommended',
'plugin:unicorn/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:prettier/recommended',
],
settings: {
'import/resolver': {
typescript: true,
node: true,
},
},
rules: {
'prettier/prettier': 'warn',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-implicit-coercion': ['error', { allow: ['!!', '+', '~'] }],
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'simple-import-sort/imports': [
'error',
{
groups: [
// Side effect imports
['^\\u0000'],
// Node.js builtins
['^node:'],
// Packages
['^@?\\w'],
// Internal packages
['^@/?\\w'],
// Absolute imports
['^'],
// Relative imports
['^\\.'],
// Style imports
['^.+\\.s?css$'],
],
},
],
'simple-import-sort/exports': 'error',
'unicorn/import-index': 'error',
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-reduce': 'off',
Expand Down
115 changes: 63 additions & 52 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8dc1ded

Please sign in to comment.