-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: package optimizations #69
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
54543b1
don't bundle thrid party libs & remove dev dependencies from package.…
DaveMBush 04af58a
remove unused file
DaveMBush 104425d
removed the need for common-tags
DaveMBush 6a4a844
removed dependency on tsutils-etc
DaveMBush bd0ccc0
replace tsutils with ts-api-utils
DaveMBush 96fe778
remove dependencies
DaveMBush 7b22075
re-remove unnecessary dependencies
DaveMBush 7a65dcc
move to flat config
DaveMBush c546447
properly type isIntersectionType()
DaveMBush 476b211
ignore another dependency for project
DaveMBush File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,68 @@ | ||
const { FlatCompat } = require('@eslint/eslintrc'); | ||
const js = require('@eslint/js'); | ||
const nxEslintPlugin = require('@nx/eslint-plugin'); | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
}); | ||
|
||
module.exports = [ | ||
{ | ||
ignores: ['**/dist'], | ||
}, | ||
{ plugins: { '@nx': nxEslintPlugin } }, | ||
{ | ||
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], | ||
rules: { | ||
'@nx/enforce-module-boundaries': [ | ||
'error', | ||
{ | ||
enforceBuildableLibDependency: true, | ||
allow: [], | ||
depConstraints: [ | ||
{ | ||
sourceTag: '*', | ||
onlyDependOnLibsWithTags: ['*'], | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
...compat | ||
.config({ | ||
extends: ['plugin:@nx/typescript'], | ||
}) | ||
.map((config) => ({ | ||
...config, | ||
files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'], | ||
rules: { | ||
...config.rules, | ||
}, | ||
})), | ||
...compat | ||
.config({ | ||
extends: ['plugin:@nx/javascript'], | ||
}) | ||
.map((config) => ({ | ||
...config, | ||
files: ['**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'], | ||
rules: { | ||
...config.rules, | ||
}, | ||
})), | ||
...compat | ||
.config({ | ||
env: { | ||
jest: true, | ||
}, | ||
}) | ||
.map((config) => ({ | ||
...config, | ||
files: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.spec.js', '**/*.spec.jsx'], | ||
rules: { | ||
...config.rules, | ||
}, | ||
})), | ||
]; |
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 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,60 @@ | ||
const { FlatCompat } = require('@eslint/eslintrc'); | ||
const js = require('@eslint/js'); | ||
const baseConfig = require('../../eslint.config.cjs'); | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
}); | ||
|
||
module.exports = [ | ||
{ | ||
ignores: ['**/dist'], | ||
}, | ||
...baseConfig, | ||
{ | ||
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], | ||
// Override or add rules here | ||
rules: {}, | ||
languageOptions: { | ||
parserOptions: { | ||
project: ['packages/eslint-plugin-rxjs/tsconfig.*?.json'], | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.ts', '**/*.tsx'], | ||
// Override or add rules here | ||
rules: {}, | ||
}, | ||
{ | ||
files: ['**/*.js', '**/*.jsx'], | ||
// Override or add rules here | ||
rules: {}, | ||
}, | ||
{ | ||
files: ['**/*.json'], | ||
rules: { | ||
'@nx/dependency-checks': [ | ||
'error', | ||
{ | ||
ignoredFiles: ['{projectRoot}/esbuild.config.{js,ts,mjs,mts}'], | ||
ignoredDependencies: [ | ||
'typescript', | ||
'@angular-eslint/test-utils', | ||
'@eslint/eslintrc', | ||
'@eslint/js', | ||
'jsonc-eslint-parser', | ||
], | ||
checkMissingDependencies: true, | ||
checkObsoleteDependencies: true, | ||
checkVersionMismatches: true, | ||
includeTransitiveDependencies: false, | ||
}, | ||
], | ||
}, | ||
languageOptions: { | ||
parser: require('jsonc-eslint-parser'), | ||
}, | ||
}, | ||
]; |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider adding TypeScript as a peer dependency.
Since the plugin relies heavily on TypeScript functionality, it should specify TypeScript as a peer dependency.
📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are reasons to leave this out as not every rule requires typescript
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaveMBush I see your point. After analyzing the codebase, indeed most rules (about 90%) don't directly depend on TypeScript functionality. They appear to be pure ESLint rules that work with JavaScript syntax. I apologize for the incorrect suggestion.
🔗 Analysis chain
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 5474
✏️ Learnings added