Skip to content

Commit

Permalink
try: migrate to eslint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
aozaki-kuro committed Aug 11, 2024
1 parent 15e80a5 commit da4018d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 73 deletions.
46 changes: 0 additions & 46 deletions .eslintrc.js

This file was deleted.

38 changes: 38 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// @ts-check
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import js from '@eslint/js'

import { FlatCompat } from '@eslint/eslintrc'
import { fixupConfigRules } from '@eslint/compat'

import ts from 'typescript-eslint'
import prettierConfigRecommended from 'eslint-plugin-prettier/recommended'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
})

const patchedConfig = fixupConfigRules([...compat.extends('next/core-web-vitals')])

const config = [
...patchedConfig,
...ts.configs.recommended,
prettierConfigRecommended,
{
ignores: ['**/.next/**', '**/_next/**', '**/dist/**', '**/out/**'],
rules: {
'@next/next/no-img-element': 'off',
'prefer-const': 'error',
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-explicit-any': 0,
},
},
]

export default config
21 changes: 0 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,5 @@
"*.{json,css,md,mdx}": [
"prettier --write"
]
},
"pnpm": {
"overrides": {
"array-includes": "npm:@nolyfill/array-includes@latest",
"array.prototype.findlastindex": "npm:@nolyfill/array.prototype.findlastindex@latest",
"array.prototype.flat": "npm:@nolyfill/array.prototype.flat@latest",
"array.prototype.flatmap": "npm:@nolyfill/array.prototype.flatmap@latest",
"array.prototype.tosorted": "npm:@nolyfill/array.prototype.tosorted@latest",
"es-iterator-helpers": "npm:@nolyfill/es-iterator-helpers@latest",
"has": "npm:@nolyfill/has@latest",
"object.assign": "npm:@nolyfill/object.assign@latest",
"object.entries": "npm:@nolyfill/object.entries@latest",
"object.fromentries": "npm:@nolyfill/object.fromentries@latest",
"object.groupby": "npm:@nolyfill/object.groupby@latest",
"object.hasown": "npm:@nolyfill/object.hasown@latest",
"object.values": "npm:@nolyfill/object.values@latest",
"string.prototype.matchall": "npm:@nolyfill/string.prototype.matchall@latest",
"hasown": "npm:@nolyfill/hasown@latest",
"array.prototype.findlast": "npm:@nolyfill/array.prototype.findlast@latest",
"array.prototype.toreversed": "npm:@nolyfill/array.prototype.toreversed@latest"
}
}
}
6 changes: 0 additions & 6 deletions postcss.config.js

This file was deleted.

9 changes: 9 additions & 0 deletions postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

export default config

0 comments on commit da4018d

Please sign in to comment.