All globs are matched only against files, folder severities are computed based on the files inside them. The formula is simple: the folder severity is the highest severity of files inside it (from highest to lowest: error, warn, off).
Glob examples:
./src/shared/**
- matches all files in theshared
folder and its subfolders./src/shared/*
- matches all files that are direct children of theshared
folder./src/shared
- based on the fact that globs are matched against files, this one matches onlyshared
file (without an extension) inside thesrc
folder**/__mocks__/**
- matches all files in all__mocks__
folders throughout the project**/*.{test,spec}.{ts,tsx}
- matches all test files in the project
// ./steiger.config.ts
import fsd from '@feature-sliced/steiger-plugin'
import { defineConfig } from 'steiger'
export default defineConfig([...fsd.configs.recommended])
import fsd from '@feature-sliced/steiger-plugin'
import { defineConfig } from 'steiger'
export default defineConfig([
...fsd.configs.recommended,
{
ignores: ['**/__mocks__/**'],
},
])
import fsd from '@feature-sliced/steiger-plugin'
import { defineConfig } from 'steiger'
export default defineConfig([
...fsd.configs.recommended,
{
rules: {
'fsd/no-processes': 'off',
'fsd/no-public-api-sidestep': 'warn',
},
},
{
files: ['./src/shared/**'],
rules: {
'fsd/public-api': 'off',
},
},
])
import fsd from '@feature-sliced/steiger-plugin'
import { defineConfig } from 'steiger'
export default defineConfig([
...fsd.configs.recommended,
{
files: ['./src/shared/**'],
rules: {
'fsd/no-public-api': 'off',
},
},
])
import fsd from '@feature-sliced/steiger-plugin'
import { defineConfig } from 'steiger'
export default defineConfig([
...fsd.configs.recommended,
{
files: ['./src/shared/**'],
ignores: ['./src/shared/lib/**', './src/shared/ui/**'],
rules: {
'fsd/no-public-api': 'off', // Disable the rule for the shared folder, but not for the lib and ui folders
},
},
])
import fsd from '@feature-sliced/steiger-plugin'
import { defineConfig } from 'steiger'
export default defineConfig([
...fsd.configs.recommended,
{
rules: {
'fsd/no-public-api': ['warn', { someOptions: true }],
},
},
{
files: ['./src/shared/**'],
rules: {
'fsd/no-public-api': 'error',
// 'fsd/no-public-api': ['error', { someOptions: false }], // Would throw an error as you can't override the options
},
},
])