Skip to content

Commit

Permalink
move local rules eslint plugin to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Aug 9, 2023
1 parent 8b5e7db commit 1559ed2
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 19 deletions.
25 changes: 13 additions & 12 deletions code/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@ module.exports = {
],
},
overrides: [
{
files: ['**/core-events/src/**/*', '!**/*.test.*'],
rules: {
'local-rules/no-duplicated-error-codes': 'error',
},
},
{
files: ['**/*.ts', '!**/*.test.*', '!**/*.spec.*'],
rules: {
'local-rules/no-uncategorized-errors': 'warn',
},
},
{
// this package depends on a lot of peerDependencies we don't want to specify, because npm would install them
files: ['**/frameworks/angular/template/**/*'],
Expand Down Expand Up @@ -179,5 +167,18 @@ module.exports = {
'import/no-unresolved': 'off',
},
},
{
files: ['**/*.ts', '!**/*.test.*', '!**/*.spec.*'],
rules: {
'local-rules/no-uncategorized-errors': 'warn',
},
},
{
files: ['**/core-events/src/**/*'],
excludedFiles: ['**/*.test.*'],
rules: {
'local-rules/no-duplicated-error-codes': 'error',
},
},
],
};
2 changes: 1 addition & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
"eslint": "^8.28.0",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-local-rules": "file:./eslint-plugin-local-rules",
"eslint-plugin-local-rules": "file:../scripts/eslint-plugin-local-rules",
"eslint-plugin-react": "^7.31.10",
"eslint-plugin-storybook": "^0.6.6",
"fs-extra": "^11.1.0",
Expand Down
8 changes: 4 additions & 4 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7639,7 +7639,7 @@ __metadata:
eslint: ^8.28.0
eslint-import-resolver-typescript: ^3.5.2
eslint-plugin-import: ^2.26.0
eslint-plugin-local-rules: "file:./eslint-plugin-local-rules"
eslint-plugin-local-rules: "file:../scripts/eslint-plugin-local-rules"
eslint-plugin-react: ^7.31.10
eslint-plugin-storybook: ^0.6.6
fs-extra: ^11.1.0
Expand Down Expand Up @@ -15620,10 +15620,10 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-local-rules@file:./eslint-plugin-local-rules::locator=%40storybook%2Froot%40workspace%3A.":
"eslint-plugin-local-rules@file:../scripts/eslint-plugin-local-rules::locator=%40storybook%2Froot%40workspace%3A.":
version: 1.0.0
resolution: "eslint-plugin-local-rules@file:./eslint-plugin-local-rules#./eslint-plugin-local-rules::hash=9b0ddb&locator=%40storybook%2Froot%40workspace%3A."
checksum: af638a30d0f98c6aabec8b1db513167421727fcebb9083cccacb7701dcbc7c09adb056a871cdf98ea3655a7fbc244518d2ce3595d1702efe1769d96e032b8b4b
resolution: "eslint-plugin-local-rules@file:../scripts/eslint-plugin-local-rules#../scripts/eslint-plugin-local-rules::hash=acbf36&locator=%40storybook%2Froot%40workspace%3A."
checksum: 6cbf01c373e283223789d702a40c15578490c0c60455398a4a1cacac43dba92b6cc641e8009ab0200463472c50e96c8242db11b543411a37726d8a2662960482
languageName: node
linkType: hard

Expand Down
12 changes: 12 additions & 0 deletions scripts/eslint-plugin-local-rules/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## ESLint plugin local rules

This package serves as a local ESLint plugin to be used in the monorepo and help maintainers keep certain code standards.

### Development

If you're fixing a rule or creating a new one, make sure to:

1. Make your code changes
2. Rerun yarn install in the `code` directory. It's necessary to update the module reference
3. Update the necessary `.eslintrc.js` files (if you are adding a new rule)
4. Restart the ESLint server in your IDE
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Local eslint plugins to be used in the monorepo and help maintainers keep certain code standards.

/* eslint-disable global-require */
module.exports = {
rules: {
Expand Down
File renamed without changes.

0 comments on commit 1559ed2

Please sign in to comment.