Skip to content

Commit

Permalink
ESLint: use the --rulesdir option for internal rules. (#3849)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov authored Feb 17, 2023
1 parent f201681 commit 3efdc54
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 28 deletions.
14 changes: 6 additions & 8 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ env:
shared-node-browser: true
reportUnusedDisableDirectives: true
plugins:
- internal-rules
- node
- import
- simple-import-sort
Expand All @@ -19,12 +18,11 @@ settings:
rules:
##############################################################################
# Internal rules located in 'resources/eslint-internal-rules'.
# See './resources/eslint-internal-rules/README.md'
##############################################################################

internal-rules/only-ascii: error
internal-rules/no-dir-import: error
internal-rules/require-to-string-tag: off
only-ascii: error
no-dir-import: error
require-to-string-tag: off

##############################################################################
# `eslint-plugin-node` rule list based on `v11.1.x`
Expand Down Expand Up @@ -658,10 +656,10 @@ overrides:
'@typescript-eslint/type-annotation-spacing': off
- files: 'src/**'
rules:
internal-rules/require-to-string-tag: error
require-to-string-tag: error
- files: 'src/**/__*__/**'
rules:
internal-rules/require-to-string-tag: off
require-to-string-tag: off
node/no-unpublished-import: [error, { allowModules: ['chai', 'mocha'] }]
import/no-deprecated: off
import/no-restricted-paths: off
Expand Down Expand Up @@ -700,7 +698,7 @@ overrides:
env:
node: true
rules:
internal-rules/only-ascii: [error, { allowEmoji: true }]
only-ascii: [error, { allowEmoji: true }]
node/no-unpublished-import: off
node/no-sync: off
import/no-namespace: off
Expand Down
10 changes: 1 addition & 9 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"changelog": "ts-node resources/gen-changelog.ts",
"benchmark": "ts-node resources/benchmark.ts",
"test": "npm run lint && npm run check && npm run testonly:cover && npm run prettier:check && npm run check:spelling && npm run check:integrations",
"lint": "eslint --cache --max-warnings 0 .",
"lint": "eslint --cache --max-warnings 0 --rulesdir resources/eslint-internal-rules/ .",
"check": "tsc --pretty",
"testonly": "mocha --full-trace src/**/__tests__/**/*-test.ts",
"testonly:cover": "c8 npm run testonly",
Expand Down Expand Up @@ -75,7 +75,6 @@
"docusaurus-plugin-typedoc-api": "2.5.0",
"eslint": "8.27.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-internal-rules": "file:./resources/eslint-internal-rules",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-react": "7.31.10",
"eslint-plugin-react-hooks": "4.6.0",
Expand Down
1 change: 0 additions & 1 deletion resources/build-docusaurus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ fs.writeFileSync(tmpDirPath('package.json'), JSON.stringify(packageJSON));

copyToTmpDir('package-lock.json');
copyToTmpDir('tsconfig.json');
copyToTmpDir('resources/eslint-internal-rules');
copyToTmpDir('src');
copyToTmpDir('website');

Expand Down
6 changes: 0 additions & 6 deletions resources/eslint-internal-rules/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions resources/eslint-internal-rules/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"name": "eslint-plugin-graphql-internal",
"version": "0.0.0",
"private": true,
"engines": {
"node": ">= 14.0.0"
Expand Down

0 comments on commit 3efdc54

Please sign in to comment.