Skip to content

Commit

Permalink
Only test modified or staged files
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Sep 23, 2024
1 parent 8628761 commit 71f9d09
Show file tree
Hide file tree
Showing 11 changed files with 766 additions and 355 deletions.
22 changes: 18 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const {
npmPackagesPath,
npmPackageNames,
prettierignorePath,
relNpmPackagesPath
relNpmPackagesPath,
rootTsConfigPath
} = require('@socketregistry/scripts/constants')

const {
Expand Down Expand Up @@ -53,7 +54,7 @@ const getIgnores = isEsm =>
})
.map(n => `${relNpmPackagesPath}/${n}/*`)

const getImportFlatConfigs = isEsm => ({
const getImportXFlatConfigs = isEsm => ({
recommended: {
...origImportXFlatConfigs.recommended,
languageOptions: {
Expand Down Expand Up @@ -89,13 +90,26 @@ const getImportFlatConfigs = isEsm => ({
]
}
},
typescript: origImportXFlatConfigs.typescript
typescript: {
...origImportXFlatConfigs.typescript,
settings: {
...origImportXFlatConfigs.typescript.settings,
'import-x/resolver': {
'eslint-import-resolver-oxc': {
tsConfig: {
configFile: rootTsConfigPath,
references: 'auto'
}
}
}
}
}
})

function configs(sourceType) {
const isEsm = sourceType === 'module'
const ignores = getIgnores(isEsm)
const importFlatConfigs = getImportFlatConfigs(isEsm)
const importFlatConfigs = getImportXFlatConfigs(isEsm)
return [
{
ignores,
Expand Down
Loading

0 comments on commit 71f9d09

Please sign in to comment.