Skip to content

Commit

Permalink
add support eslint-disable
Browse files Browse the repository at this point in the history
  • Loading branch information
woohm402 committed May 31, 2024
1 parent ee70d33 commit f7d69f6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/base/__tests__/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ describe('@woohm402/eslint-config-base', function () {
it('wrong', async function () {
const [result] = await eslint.lintFiles([`${__dirname}/wrong.ts`]);

expect(result.errorCount).toBe(2);
expect(result.errorCount).toBe(3);
});
});
1 change: 1 addition & 0 deletions packages/base/__tests__/wrong.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import typescript from 'typescript';
import eslint from 'eslint';

// eslint-disable-next-line no-console
console.log({ eslint, typescript });
8 changes: 7 additions & 1 deletion packages/base/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import ESLintPluginESLintCommentsConfigs from '@eslint-community/eslint-plugin-eslint-comments/configs';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(eslint.configs.recommended, eslintPluginPrettierRecommended, ...tseslint.configs.recommended, {
plugins: { 'simple-import-sort': simpleImportSort },
plugins: {
'simple-import-sort': simpleImportSort,
'@eslint-community/eslint-comments':
ESLintPluginESLintCommentsConfigs.recommended.plugins['@eslint-community/eslint-comments'],
},
rules: {
'simple-import-sort/imports': 'error',
'@eslint-community/eslint-comments/no-use': ['error', { allow: [] }],
'no-restricted-syntax': [
'error',
{
Expand Down
1 change: 1 addition & 0 deletions packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
},
"homepage": "https://github.com/woohm402/eslint-config-woohm402#readme",
"dependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "4.3.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-simple-import-sort": "12.1.0",
Expand Down
14 changes: 11 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@
resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz#9c907b21e30a52db959ba4f80bb01a0cc403d5cc"
integrity sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==

"@eslint-community/eslint-plugin-eslint-comments@^4.3.0":
version "4.3.0"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-4.3.0.tgz#e356a280764e14b1db9c94d0be7fab405431e2a6"
integrity sha512-6e93KtgsndNkvwCCa07LOQJSwzzLLxwrFll3+huyFoiiQXWG0KBcmo0Q1bVgYQQDLfWOOZl2VPBsXqZL6vHIBQ==
dependencies:
escape-string-regexp "^4.0.0"
ignore "^5.2.4"

"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0":
version "4.4.0"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
Expand Down Expand Up @@ -296,7 +304,7 @@
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e"
integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==

"@types/eslint@^8.56.10":
"@types/[email protected]":
version "8.56.10"
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.56.10.tgz#eb2370a73bf04a901eeba8f22595c7ee0f7eb58d"
integrity sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==
Expand All @@ -314,7 +322,7 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841"
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==

"@types/node@^20.12.13":
"@types/[email protected]":
version "20.12.13"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.13.tgz#90ed3b8a4e52dd3c5dc5a42dde5b85b74ad8ed88"
integrity sha512-gBGeanV41c1L171rR7wjbMiEpEI/l5XFQdLLfhr/REwpgDy/4U8y89+i8kRiLzDyZdOkXh+cRaTetUnCYutoXA==
Expand Down Expand Up @@ -929,7 +937,7 @@ human-signals@^5.0.0:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28"
integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==

ignore@^5.2.0, ignore@^5.3.1:
ignore@^5.2.0, ignore@^5.2.4, ignore@^5.3.1:
version "5.3.1"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef"
integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==
Expand Down

0 comments on commit f7d69f6

Please sign in to comment.