@alveole/eslint-config 0.23.4 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -65
- package/package.json +1 -1
- package/rules/_shared.js +6 -0
package/index.js
CHANGED
|
@@ -4,68 +4,7 @@ const sharedRules = require('./rules/_shared');
|
|
|
4
4
|
const styleRules = require('./rules/styles');
|
|
5
5
|
const serviceRules = require('./rules/services');
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
files: ['**/*.{ts,tsx}'],
|
|
14
|
-
rules: {
|
|
15
|
-
'no-redeclare': 'off',
|
|
16
|
-
'@typescript-eslint/no-redeclare': ['error', { ignoreDeclarationMerge: true }],
|
|
17
|
-
'no-restricted-properties': [
|
|
18
|
-
'error',
|
|
19
|
-
{
|
|
20
|
-
object: 'window',
|
|
21
|
-
property: 'open',
|
|
22
|
-
message: 'N’utilisez pas window.open. Utilisez Linking.openURL (expo) à la place.',
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
'no-unused-vars': 'off',
|
|
26
|
-
'@typescript-eslint/no-unused-vars': [
|
|
27
|
-
'error',
|
|
28
|
-
{
|
|
29
|
-
argsIgnorePattern: '^_',
|
|
30
|
-
varsIgnorePattern: '^_',
|
|
31
|
-
caughtErrorsIgnorePattern: '^_',
|
|
32
|
-
ignoreRestSiblings: true,
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
files: ['**/*.styles.ts'],
|
|
39
|
-
rules: {
|
|
40
|
-
'no-restricted-syntax': [
|
|
41
|
-
'error',
|
|
42
|
-
{
|
|
43
|
-
selector: "Property[key.name='transition'], Property[key.value='transition']",
|
|
44
|
-
message:
|
|
45
|
-
'N’utilisez pas la propriété CSS transition. Utilisez transitionBehavior, transitionDelay, transitionDuration, transitionProperty ou transitionTimingFunction à la place.',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
selector:
|
|
49
|
-
"Property[key.name='padding'] > Literal[value=/\\s+/], Property[key.value='padding'] > Literal[value=/\\s+/]",
|
|
50
|
-
message:
|
|
51
|
-
'N’utilisez pas la forme raccourcie padding avec plusieurs valeurs. Utilisez paddingTop, paddingBottom, paddingLeft et paddingRight à la place.',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
selector: "Property[key.name='border'], Property[key.value='border']",
|
|
55
|
-
message:
|
|
56
|
-
'N’utilisez pas la propriété raccourcie border. Utilisez borderColor, borderWidth, borderStyle, etc. à la place.',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
selector: "Property[key.name='background'], Property[key.value='background']",
|
|
60
|
-
message: 'N’utilisez pas la propriété raccourcie background. Utilisez backgroundColor, etc. à la place.',
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
files: ['**/services/**/*.{ts,tsx}'],
|
|
67
|
-
rules: {
|
|
68
|
-
'@typescript-eslint/no-redeclare': 'off',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
]);
|
|
7
|
+
/** @type {import('eslint').Linter.Config[]} */
|
|
8
|
+
const config = defineConfig([expoConfig, { ignores: ['dist/**'] }, sharedRules, styleRules, serviceRules]);
|
|
9
|
+
|
|
10
|
+
module.exports = config;
|
package/package.json
CHANGED
package/rules/_shared.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
const flashListPlugin = require('../plugins/flash-list');
|
|
2
|
+
|
|
1
3
|
/** @type {import('eslint').Linter.Config} */
|
|
2
4
|
const config = {
|
|
3
5
|
files: ['**/*.{ts,tsx}'],
|
|
6
|
+
plugins: {
|
|
7
|
+
flashList: flashListPlugin,
|
|
8
|
+
},
|
|
4
9
|
rules: {
|
|
5
10
|
'no-redeclare': 'off',
|
|
6
11
|
'@typescript-eslint/no-redeclare': ['error', { ignoreDeclarationMerge: true }],
|
|
12
|
+
'flashList/prefer-flash-list': 'error',
|
|
7
13
|
'no-restricted-properties': [
|
|
8
14
|
'error',
|
|
9
15
|
{
|