aboutsummaryrefslogtreecommitdiffstats
path: root/.eslintrc.cjs
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-01-09 22:16:29 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-01-09 22:17:26 +0100
commitfb7118ff1c8f0dcd61f15e51b193512283d83fa1 (patch)
tree721cee6a64b44a56b7f05f39750a65cda5fb4ef6 /.eslintrc.cjs
parentbuild: Add eslint-plugin-jest (diff)
downloadsophie-fb7118ff1c8f0dcd61f15e51b193512283d83fa1.tar.gz
sophie-fb7118ff1c8f0dcd61f15e51b193512283d83fa1.tar.zst
sophie-fb7118ff1c8f0dcd61f15e51b193512283d83fa1.zip
build: Add eslint-plugin-unicorn
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to '.eslintrc.cjs')
-rw-r--r--.eslintrc.cjs22
1 files changed, 22 insertions, 0 deletions
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 5bb3c21..e984179 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -12,6 +12,7 @@ module.exports = {
12 'plugin:jest/recommended', 12 'plugin:jest/recommended',
13 'plugin:jest/style', 13 'plugin:jest/style',
14 'plugin:prettier/recommended', 14 'plugin:prettier/recommended',
15 'plugin:unicorn/recommended',
15 ], 16 ],
16 env: { 17 env: {
17 es6: true, 18 es6: true,
@@ -51,6 +52,20 @@ module.exports = {
51 'newlines-between': 'always', 52 'newlines-between': 'always',
52 }, 53 },
53 ], 54 ],
55 // Allows files with names same as the name of their default export.
56 'unicorn/filename-case': [
57 'error',
58 {
59 cases: {
60 camelCase: true,
61 pascalCase: true,
62 },
63 },
64 ],
65 // Airbnb prefers forEach.
66 'unicorn/no-array-for-each': 'off',
67 // Common abbreviations are known and readable.
68 'unicorn/prevent-abbreviations': 'off',
54 }, 69 },
55 overrides: [ 70 overrides: [
56 { 71 {
@@ -120,5 +135,12 @@ module.exports = {
120 'import/no-relative-packages': 'off', 135 'import/no-relative-packages': 'off',
121 }, 136 },
122 }, 137 },
138 {
139 files: ['scripts/**/*.js'],
140 rules: {
141 // Scripts are allowed to `exit` abruptly.
142 'unicorn/no-process-exit': 'off',
143 },
144 },
123 ], 145 ],
124}; 146};