-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e379415
commit 6e613a8
Showing
14 changed files
with
191 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,50 @@ | ||
import stylistic from '@stylistic/eslint-plugin-js' | ||
import stylistic from '@stylistic/eslint-plugin' | ||
import pluginImport from 'eslint-plugin-import' | ||
import perfectionist from 'eslint-plugin-perfectionist' | ||
import perfectionistNatural from 'eslint-plugin-perfectionist/configs/recommended-natural' | ||
import prettierConfig from 'eslint-plugin-prettier/recommended' | ||
import promise from 'eslint-plugin-promise' | ||
import is from 'eslint-plugin-simple-import-sort' | ||
import eslintPluginUnicorn from 'eslint-plugin-unicorn' | ||
|
||
export default [ | ||
prettierConfig, | ||
eslintPluginUnicorn.configs['flat/recommended'], | ||
|
||
perfectionistNatural, | ||
stylistic.configs['recommended-flat'], | ||
{ | ||
files: ['**/*.js'], | ||
plugins: { | ||
stylistic, | ||
pluginImport, | ||
'simple-import-sort': is, | ||
perfectionist, | ||
import: pluginImport, | ||
}, | ||
languageOptions: { | ||
ecmaVersion: 2024, | ||
sourceType: 'module', | ||
}, | ||
plugins: { | ||
import: pluginImport, | ||
pluginImport, | ||
promise, | ||
'simple-import-sort': is | ||
|
||
}, | ||
|
||
rules: { | ||
'simple-import-sort/imports': 'error', | ||
'simple-import-sort/exports': 'error', | ||
|
||
'no-unused-vars': 'warn', | ||
'no-console': 'off', | ||
'no-unused-vars': 'warn', | ||
|
||
'promise/always-return': 'error', | ||
'promise/avoid-new': 'warn', | ||
'promise/catch-or-return': 'error', | ||
'promise/no-callback-in-promise': 'warn', | ||
'promise/no-native': 'off', | ||
'promise/no-nesting': 'warn', | ||
'promise/no-new-statics': 'error', | ||
'promise/no-promise-in-callback': 'warn', | ||
'promise/no-return-in-finally': 'warn', | ||
'promise/no-return-wrap': 'error', | ||
'promise/param-names': 'error', | ||
'promise/valid-params': 'warn', | ||
'simple-import-sort/exports': 'error', | ||
'simple-import-sort/imports': 'error', | ||
'unicorn/no-null': 'warn', | ||
'unicorn/prefer-top-level-await': 'off', | ||
'unicorn/prevent-abbreviations': 'warn', | ||
}, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { fileURLToPath } from 'url' | ||
import path from 'path' | ||
import path from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
const __dirname = path.dirname(fileURLToPath(import.meta.url)) | ||
|
||
export default path.resolve(`${__dirname}/../`) | ||
export default path.resolve(`${__dirname}/../`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import fs from 'node:fs/promises' | ||
const exists = async (path) => { | ||
try { | ||
await fs.access(path) | ||
return true | ||
} catch { | ||
return false | ||
} | ||
} | ||
|
||
export default exists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.