Skip to content
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

Feat/exclude sherif.config.ts from sheriff eslint rules #167

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build:all": "npx nx run-many --target=build && chmod +x dist/packages/core/src/bin/main.js",
"commit": "commit",
"lint:all": "eslint ./packages",
"link:sheriff": "npm run build:all && yalc publish dist/packages/core && yalc publish dist/packages/eslint-plugin && yalc link @softarc/sheriff-core @softarc/eslint-plugin-sheriff",
"link:sheriff": "yarn run build:all && yalc publish dist/packages/core && yalc publish dist/packages/eslint-plugin && yalc link @softarc/sheriff-core @softarc/eslint-plugin-sheriff",
"run:cli": "nx build core && chmod +x dist/packages/core/src/bin/main.js",
"test": "vitest",
"test:ci": "vitest -c vitest.config.ci.ts"
Expand Down
20 changes: 9 additions & 11 deletions packages/eslint-plugin/src/lib/configs/all.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import rules from '../rules';
import type { TSESLint } from '@typescript-eslint/utils';
import rules from '../rules';

export const barrelModulesOnly: TSESLint.FlatConfig.Config = {
const commonConfig: TSESLint.FlatConfig.Config = {
files: ['*.ts, *.js'],
ignores: ['sheriff.config.ts'],
languageOptions: {
sourceType: 'module',
},
Expand All @@ -10,22 +12,18 @@ export const barrelModulesOnly: TSESLint.FlatConfig.Config = {
rules,
},
},
};

export const barrelModulesOnly: TSESLint.FlatConfig.Config = {
...commonConfig,
rules: {
'@softarc/sheriff/dependency-rule': 'error',
'@softarc/sheriff/deep-import': 'error',
},
};


export const all: TSESLint.FlatConfig.Config = {
languageOptions: {
sourceType: 'module',
},
plugins: {
'@softarc/sheriff': {
rules,
},
},
...commonConfig,
rules: {
'@softarc/sheriff/dependency-rule': 'error',
'@softarc/sheriff/encapsulation': 'error',
Expand Down
7 changes: 3 additions & 4 deletions packages/eslint-plugin/src/lib/configs/legacy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ESLint } from "eslint";
import { ESLint } from 'eslint';

export const legacyBarrelModulesOnly: ESLint.ConfigData = {
parser: '@typescript-eslint/parser',
Expand All @@ -7,7 +7,7 @@ export const legacyBarrelModulesOnly: ESLint.ConfigData = {
'@softarc/sheriff/dependency-rule': 'error',
'@softarc/sheriff/deep-import': 'error',
},
}
};

export const legacy: ESLint.ConfigData = {
parser: '@typescript-eslint/parser',
Expand All @@ -16,5 +16,4 @@ export const legacy: ESLint.ConfigData = {
'@softarc/sheriff/dependency-rule': 'error',
'@softarc/sheriff/encapsulation': 'error',
},
}

};
1 change: 0 additions & 1 deletion tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"extends": "./tsconfig.base.json",
"include": ["**/*.spec.ts"]
]
}
Loading