diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..d13a6f0 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,17 @@ +{ + "semi": true, + "trailingComma": "all", + "singleQuote": true, + "printWidth": 150, + "tabWidth": 4, + + "overrides": [ + { + "files": ["*.yml", "*.yaml"], + "options": { + "bracketSpacing": false, + "tabWidth": 2 + } + } + ] +} diff --git a/eslint.js b/eslint.js new file mode 100644 index 0000000..8a616c9 --- /dev/null +++ b/eslint.js @@ -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', + }, +} diff --git a/package-lock.json b/package-lock.json index b8d5835..f70f619 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@typescript-eslint/eslint-plugin": "8.3.0", "@typescript-eslint/parser": "8.3.0", - "eslint": "8.57.0", + "eslint": ">=8", "eslint-config-prettier": "9.1.0", "eslint-plugin-css-modules": "2.12.0", "eslint-plugin-import": "2.29.1", diff --git a/package.json b/package.json index fca56f3..b81fb26 100644 --- a/package.json +++ b/package.json @@ -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",