Skip to content

Commit

Permalink
Updates ruleset for eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
terjeofnorway committed Sep 3, 2024
1 parent 78dd548 commit 44048ea
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 150,
"tabWidth": 4,

"overrides": [
{
"files": ["*.yml", "*.yaml"],
"options": {
"bracketSpacing": false,
"tabWidth": 2
}
}
]
}
35 changes: 35 additions & 0 deletions eslint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
plugins: ['css-modules', '@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'@typescript-eslint/recommended-requiring-type-checking',
'plugin:react/jsx-runtime',
'plugin:jsx-a11y/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
rules: {
'import/order': [
'warn',
{
groups: [
['builtin', 'external'],
['internal', 'parent', 'index', 'object', 'unknown', 'type'],
'sibling',
],
pathGroups: [
{
pattern: './**/*.module.scss',
group: 'sibling',
position: 'after',
},
],
},
],
'css-modules/no-unused-class': ['warn', { camelCase: true }],
'css-modules/no-undef-class': ['error', { camelCase: true }],
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
},
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
"dependencies": {
"@typescript-eslint/eslint-plugin": "8.3.0",
"@typescript-eslint/parser": "8.3.0",
"eslint": ">=8",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-css-modules": "2.12.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-react": "7.35.0",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-testing-library": "6.3.0",
"eslint-plugin-css-modules": "2.12.0",
"eslint": "8.57.0"
"eslint-plugin-testing-library": "6.3.0"
},
"peerDependencies": {
"eslint": ">=8",
Expand Down

0 comments on commit 44048ea

Please sign in to comment.