forked from datenanfragen/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
103 lines (97 loc) · 2.87 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
const path = require('path');
module.exports = {
parser: 'babel-eslint',
env: {
browser: true,
es6: true,
amd: true,
worker: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:jsx-a11y/recommended',
'plugin:cypress/recommended',
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['react', 'preact-i18n', 'import', 'babel', 'html', 'optimize-regex', 'json', 'jsx-a11y'],
rules: {
'no-unused-vars': ['warn', { args: 'none', caughtErrors: 'none' }],
'no-empty': ['error', { allowEmptyCatch: true }],
// Re-enable the `no-console` rule which gets disabled by the Node env.
'no-console': 'error',
'react/no-did-update-set-state': 'warn',
'react/jsx-no-bind': [
'error',
{
allowArrowFunctions: true,
allowBind: false,
ignoreRefs: true,
},
],
'react/react-in-jsx-scope': 'off',
'react/jsx-key': 'off',
'react/no-unknown-property': ['error', { ignore: ['for'] }],
'optimize-regex/optimize-regex': 'warn',
},
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
// defined in `layouts/partials/scripts.html`
globals: 'readonly',
BASE_URL: 'readonly',
LOCALE: 'readonly',
SUPPORTED_LANGUAGES: 'readonly',
SUPPORTED_COUNTRIES: 'readonly',
COUNTRIES_WITH_SUGGESTED_COMPANIES: 'readonly',
// defined in `src/general.js`
I18N_DEFINITION: 'readonly',
I18N_DEFINITION_REQUESTS: 'readonly',
// defined in `webpack.common.js`
CODE_VERSION: 'readonly',
},
settings: {
react: {
pragma: 'h',
version: 'latest',
},
'preact-i18n': {
languageFiles: [
{
name: 'en',
path: 'src/i18n/en.json',
},
{
name: 'de',
path: 'src/i18n/de.json',
},
{
name: 'fr',
path: 'src/i18n/fr.json',
},
{
name: 'pt',
path: 'src/i18n/pt.json',
},
{
name: 'es',
path: 'src/i18n/es.json',
},
{
name: 'hr',
path: 'src/i18n/hr.json',
},
],
},
'import/resolver': { webpack: { config: path.resolve(__dirname, 'webpack.common.js') } },
},
};