Skip to content

Commit

Permalink
style: centralize eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
c100k committed Aug 23, 2024
1 parent 007c2a3 commit 58f4028
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
36 changes: 20 additions & 16 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,28 @@ module.exports = {
env: {
node: true,
},
extends: [
'plugin:sonarjs/recommended-legacy',
],
overrides: [{
files: ['*.ts', '*.mts', '*.cts', '*.tsx'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'explicit',
overrides: {
constructors: 'no-public',
extends: ['plugin:sonarjs/recommended-legacy'],
overrides: [
{
files: ['*.js', '*.jsx', '*.cjs', '*.mjs'],
rules: {},
},
{
files: ['*.ts', '*.tsx', '*.cts', '*.mts'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'explicit',
overrides: {
constructors: 'no-public',
},
},
},
],
],
},
},
}],
],
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.4.0",
"type": "module",
"scripts": {
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --cache --debug --fix && prettier --write '**/*.json'",
"lint:ci": "eslint . --ext .js,.jsx,.ts,.tsx && prettier '**/*.json'",
"lint": "eslint . --cache --debug --fix && prettier --write '**/*.json'",
"lint:ci": "eslint . && prettier '**/*.json'",
"test": "tsc"
},
"devDependencies": {
Expand Down

0 comments on commit 58f4028

Please sign in to comment.