Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
35eddf1
build: update eslint to v9
conarti Sep 30, 2024
7a9bacf
style(eslint): migrate to v9, uninstall old plugins, replace with atf…
conarti Oct 1, 2024
3f966d7
build(package-json): update author info
conarti Oct 1, 2024
d5c9702
build(package-json): up eslint peer dependency version to 9
conarti Oct 1, 2024
76367bb
chore(eslint): off 'ts/explicit-function-return-type' rule
conarti Oct 2, 2024
44121b1
build: migrate plugin to v9
conarti Oct 2, 2024
7cf8edc
build: migrate from unbuild to tsup
conarti Oct 3, 2024
32bf58c
chore(deps): update @total-typescript/ts-reset to 0.6.1
conarti Oct 6, 2024
90bb1ef
fix(layers): isLayers ts error
conarti Oct 6, 2024
97ad1f5
refactor(import-order): remove duplicates
conarti Oct 6, 2024
d514a14
docs(import-order): add names for configurations
conarti Oct 19, 2024
cbb2ecb
feat: initialize the plugin through the factory
conarti Oct 19, 2024
b151623
feat: add settings for each rule
conarti Oct 20, 2024
8e03f9f
feat: add ability to disable every rule
conarti Oct 20, 2024
b342565
refactor(configs): remove unused config files in configs
conarti Dec 7, 2024
9352e63
refactor(create-plugin): separate rule definition logic
conarti Dec 7, 2024
57bc37c
refactor(create-plugin): rename setupSortImports function for clarity
conarti Dec 7, 2024
ce10c56
chore: bump version to 2.0.0-rc.1
conarti Dec 7, 2024
cd1f39a
chore(package): update Node.js engine requirement to >= 18.0.0 only
conarti Dec 7, 2024
86f42fa
docs(readme): update plugin usage and install guide
conarti Dec 7, 2024
373c66f
refactor: unify rule architecture and simplify create-plugin
conarti Sep 17, 2025
43b0732
refactor: centralize import-order rule configurations
conarti Sep 17, 2025
7a0a2a7
fix: correct config names to use @conarti/feature-sliced prefix
conarti Sep 17, 2025
dd9d2aa
chore: bump version to 2.0.0-rc.2
conarti Sep 17, 2025
4604199
fix: prevent false positives for cross-layer imports with same slice …
conarti Sep 30, 2025
a554660
refactor: migrate tests to ESLint flat config format
conarti Sep 30, 2025
a7a2e7b
feat: update "@typescript-eslint" deps versions
conarti Sep 30, 2025
b26b687
feat: update "tsup" version
conarti Sep 30, 2025
6fb93b9
fix: vulnerabilities "npm audit fix"
conarti Sep 30, 2025
01fa905
fix: rename "typecheck" command to "type-check"
conarti Sep 30, 2025
4e7bf19
refactor: migrate to @typescript-eslint/rule-tester
conarti Sep 30, 2025
c3ab35c
refactor: use proper RuleModule type from @typescript-eslint/utils
conarti Sep 30, 2025
696452e
test: fix layers-slices tests and add skipped cwd tests
conarti Sep 30, 2025
4765031
docs: add reference to typescript-eslint issue #11668
conarti Sep 30, 2025
2930f4f
feat: update "eslint-plugin-import-x" version
conarti Sep 30, 2025
406a8cc
test: fix absolute-relative and public-api tests, add skipped cwd tests
conarti Oct 28, 2025
71ea942
fix: remove incompatible ESLint.Plugin type annotation
conarti Oct 28, 2025
2a1e9c3
fix(public-api): remove file extensions from directory import suggest…
conarti Oct 28, 2025
f4a91c3
refactor(public-api): use universal regex for file extension removal
conarti Oct 28, 2025
037052e
chore: bump version to 2.0.0-rc.3
conarti Oct 28, 2025
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
Binary file added .DS_Store
Binary file not shown.
149 changes: 0 additions & 149 deletions .eslintrc.js

This file was deleted.

81 changes: 43 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,55 +68,60 @@ You'll first need to install [ESLint](https://eslint.org/):
npm i eslint --save-dev
```

Next, install `@conarti/eslint-plugin-feature-sliced` and dependencies:
Next, install `@conarti/eslint-plugin-feature-sliced`:

```sh
npm install -D @conarti/eslint-plugin-feature-sliced eslint-plugin-import
# or by yarn
yarn add -D @conarti/eslint-plugin-feature-sliced eslint-plugin-import
npm i -D @conarti/eslint-plugin-feature-sliced
```

Note: 'eslint-plugin-import' is optional. You can skip installing this plugin if you don't need to sort imports in your code.
Note: the plugin may conflict with other import sorting plugins installed in your project.
If you do not want to use this plugin's sorting, disable it. More about this below

## Quick Usage
## Usage

Add `@conarti/feature-sliced/recommended` to extends section of your `.eslintrc` configuration file.
It enables all rules and additional recommended configs of other eslint plugins, like `eslint-plugin-import`.
For simple use with loose settings, just call the function:

```json
{
"extends": [
"plugin:@conarti/feature-sliced/recommended"
]
}
```js
// eslint.config.js
import featureSliced from '@conarti/eslint-plugin-feature-sliced';

export default [
featureSliced(),
]
```

## Customisation

If you want to use only plugin rules, add `@conarti/feature-sliced/rules` instead.

```json
{
"extends": [
"plugin:@conarti/feature-sliced/rules"
]
}
```

If you only want to use certain rules, you can add them individually. To do this, you need to add `@conarti/feature-sliced` to the 'plugins'
section of the configuration file and add the desired rules to the 'rules' section. Also now you don't need to use the 'extends' section like before

```json
{
"plugins": [
"@conarti/feature-sliced"
],
"rules": {
"@conarti/feature-sliced/layers-slices": "error",
"@conarti/feature-sliced/absolute-relative": "error",
"@conarti/feature-sliced/public-api": "error"
}
}
You can also manage any rule and disable them:

```js
import featureSliced from '@conarti/eslint-plugin-feature-sliced';

export default [
featureSliced({
/* Enables public api check in segments */
publicApi: { level: 'segments' },
/* Uses a different import sorter. You can disable it and use your own plugins and configurations */
sortImports: 'with-newlines',
/* This is how you can completely disable the rule */
absoluteRelative: false,
layersSlices: {
/* This is how you can disable the rule for imports in any files (ignore paths in code) */
ignorePatterns: [
/**
* Please note that the plugin reads the entire file path from the root of your system, not the project.
* That's why we added "**" to the beginning.
*/
"**/src/components/**/*"
],
/* This is how you can disable the rule for files or folders (ignore all paths in files or folders) */
ignoreInFilesPatterns: [
/* Do not check imports like "import foo from '@/app/some-module/foo'" */
"@/app/some-module/*",
],
},
}),
]
```

## Rules
Expand Down
22 changes: 11 additions & 11 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { defineConfig } from 'vitepress'
import { defineConfig } from 'vitepress';

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Feature Sliced Eslint Plugin",
description: "Feature Sliced Design Eslint Plugin Docs",
title: 'Feature Sliced Eslint Plugin',
description: 'Feature Sliced Design Eslint Plugin Docs',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Examples', link: '/markdown-examples' }
{ text: 'Examples', link: '/markdown-examples' },
],

sidebar: [
{
text: 'Examples',
items: [
{ text: 'Markdown Examples', link: '/markdown-examples' },
{ text: 'Runtime API Examples', link: '/api-examples' }
]
}
{ text: 'Runtime API Examples', link: '/api-examples' },
],
},
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
]
}
})
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' },
],
},
});
12 changes: 6 additions & 6 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import Theme from 'vitepress/theme';
// https://vitepress.dev/guide/custom-theme
import { h } from 'vue'
import Theme from 'vitepress/theme'
import './style.css'
import { h } from 'vue';
import './style.css';

export default {
...Theme,
Layout: () => {
return h(Theme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
});
},
enhanceApp({ app, router, siteData }) {
// ...
}
}
},
};
16 changes: 16 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import antfu from '@antfu/eslint-config';

export default antfu({
type: 'lib',
stylistic: {
semi: true,
},
gitignore: true,
ignores: ['**/*.md'],
}, {
rules: {
'style/quotes': ['error', 'single', { avoidEscape: true }],
'style/arrow-parens': ['error', 'always'],
'ts/explicit-function-return-type': 'off',
},
});
Loading