Skip to content

Commit

Permalink
fixup! Feat(eslint-config): Introduce sharable ESlint preset
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Feb 20, 2025
1 parent a9ca202 commit a70d9be
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions configs/eslint-config-spirit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,23 @@ module.exports = {
plugins: ['promise', 'react', '@typescript-eslint', 'prettier', 'react-refresh'],

rules: {
/**
* Use prettier config for code formatting
*
* @see { @link https://github.com/prettier/eslint-plugin-prettier }
*/
'prettier/prettier': [
'error',
{
...prettierConfig,
},
],

/**
* Set sorting of imports
*
* @see { @link https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md }
*/
'import/order': [
'error',
{
Expand All @@ -59,18 +69,36 @@ module.exports = {
},
],

// 'no-param-reassign': ['warn', { props: true }],
// allow reassign in properties

/**
* Allow reassignment of params in properties
*
* @see { @link https://eslint.org/docs/latest/rules/no-param-reassign }
*/
'no-param-reassign': ['warn', { props: false }],

// allow ++ in for loops
/**
* Allow `++`/`--` in for loops
*
* @see { @link https://eslint.org/docs/rules/no-plusplus }
*/
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],

// disable double quotes
/**
* Warn when not using single quotes
*
* @see { @link https://eslint.org/docs/latest/rules/quotes }
*/
quotes: ['warn', 'single'],

// There are places where arrow body make sense and where does not
// @todo create a guideline for this
/**
* Disable arrow body style
* There are places where arrow body make sense and where does not
*
* @todo create a guideline for this
*
* @see { @link https://eslint.org/docs/latest/rules/arrow-body-style }
*/
'arrow-body-style': 'off',
},
};

0 comments on commit a70d9be

Please sign in to comment.