-
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.
Merge pull request #243 from allohamora/feature/eslint-flat-config
Feature/eslint flat config
- Loading branch information
Showing
18 changed files
with
4,814 additions
and
3,449 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,22 @@ | ||
const red = (log) => `\x1b[31m${log}\x1b[0m`; | ||
|
||
module.exports = { | ||
deep: true, | ||
upgrade: true, | ||
|
||
/** | ||
* @description https://github.com/raineorshine/npm-check-updates?tab=readme-ov-file#filterresults | ||
* @param {string} packageName | ||
* @param {{ currentVersion: string, upgradedVersion: string }} versions | ||
* @returns {boolean} | ||
*/ | ||
filterResults: (packageName, { currentVersion, upgradedVersion }) => { | ||
if (currentVersion.startsWith('^')) { | ||
return true; | ||
} | ||
|
||
console.warn(red(`${packageName}@${currentVersion} wasn't upgraded to ${upgradedVersion} because it is static`)); | ||
|
||
return false; | ||
}, | ||
}; |
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
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// @ts-check | ||
import globals from 'globals'; | ||
import eslint from '@eslint/js'; | ||
import tsPlugin from '@typescript-eslint/eslint-plugin'; | ||
import beautifulSort from 'eslint-plugin-beautiful-sort'; | ||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; | ||
import tseslint from 'typescript-eslint'; | ||
|
||
export default tseslint.config( | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
eslintPluginPrettierRecommended, | ||
{ | ||
files: ['**/*.ts'], | ||
ignores: ['node_modules', 'dist', 'bin'], | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
...globals.jest, | ||
}, | ||
parserOptions: { | ||
project: true, | ||
}, | ||
}, | ||
plugins: { | ||
'@typescript-eslint': tsPlugin, | ||
'beautiful-sort': beautifulSort, | ||
}, | ||
rules: { | ||
'no-use-before-define': 'error', | ||
'object-shorthand': 'warn', | ||
'no-async-promise-executor': 'warn', | ||
'@typescript-eslint/consistent-type-definitions': ['error', 'type'], | ||
'@typescript-eslint/interface-name-prefix': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'@typescript-eslint/no-misused-promises': 'warn', | ||
'@typescript-eslint/no-deprecated': 'error', | ||
'beautiful-sort/import': [ | ||
'error', | ||
{ | ||
special: [], | ||
order: ['special', 'namespace', 'default', 'defaultObj', 'obj', 'none'], | ||
}, | ||
], | ||
}, | ||
}, | ||
); |
Oops, something went wrong.