Skip to content

Commit

Permalink
Merge pull request #354 from rolling-scopes/feat/320-set-up-eslint-fo…
Browse files Browse the repository at this point in the history
…r-fsd

320-feat: add FSD eslint config
  • Loading branch information
Quiddlee authored Jul 6, 2024
2 parents ffcbfe9 + 22ea83e commit 82f25bb
Show file tree
Hide file tree
Showing 3 changed files with 1,724 additions and 640 deletions.
11 changes: 11 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
import stylistic from '@stylistic/eslint-plugin';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
Expand All @@ -11,6 +12,13 @@ import sortExports from 'eslint-plugin-sort-exports';
import vitestPlugin from 'eslint-plugin-vitest';
import globals from 'globals';

const DIRNAME = import.meta.dirname;
const compat = new FlatCompat({ baseDirectory: DIRNAME });
const fsdConfig = compat.extends('@feature-sliced/eslint-config');

// Pop is needed to remove 'ecmaVersion: 2015' to fix the error 💫
fsdConfig.pop();

export default [
{
ignores: [
Expand All @@ -26,6 +34,7 @@ export default [
],
},
stylistic.configs['recommended-flat'],
...fsdConfig,
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
languageOptions: {
Expand Down Expand Up @@ -76,6 +85,7 @@ export default [
...vitestPlugin.configs['recommended'].rules,
...cssImportOrder.configs['recommended'].rules,

'boundaries/element-types': 'warn',
'no-undef': 'off',
'no-restricted-exports': [
'warn',
Expand All @@ -102,6 +112,7 @@ export default [
'import/no-namespace': ['error', { ignore: ['*.ext'] }],
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'import/no-internal-modules': 'warn',
'import/order': [
'error',
{
Expand Down
Loading

0 comments on commit 82f25bb

Please sign in to comment.