@st1ggy/linter-config 1.0.46 → 1.0.48

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@st1ggy/linter-config",
3
- "version": "1.0.46",
3
+ "version": "1.0.48",
4
4
  "description": "ESLint, Stylelint and Prettier configs for React, Vue [WIP] and Svelte [WIP]",
5
5
  "private": false,
6
6
  "main": "index.js",
@@ -53,11 +53,35 @@ export default [
53
53
  ignoreDeclarationSort: true,
54
54
  },
55
55
  ],
56
- quotes: ['error', 'single'],
56
+ quotes: ['error', 'single', { avoidEscape: true }],
57
57
  'object-shorthand': 'error',
58
58
  'prefer-const': 'error',
59
59
  'class-methods-use-this': 'off',
60
60
  'spaced-comment': ['error', 'always'],
61
+ 'no-restricted-syntax': [
62
+ 'error',
63
+ {
64
+ selector: 'WithStatement',
65
+ message: '`with` statement are not allowed.',
66
+ },
67
+ {
68
+ selector: 'ForInStatement',
69
+ message: 'Use for..of instead.',
70
+ },
71
+ {
72
+ selector: 'TSEnumDeclaration',
73
+ message: "Don't declare enums, use type union of literal strings or constants.",
74
+ },
75
+ {
76
+ selector: 'MemberExpression[object.name="React"]',
77
+ message: 'Use named imports from react.',
78
+ },
79
+ {
80
+ selector:
81
+ 'CallExpression[callee.property.name="replaceAll"] > Literal[regex.flags=/^[^g]*$/].arguments:first-child',
82
+ message: 'Missing "g" flag in regular expression.',
83
+ },
84
+ ],
61
85
  },
62
86
  },
63
87
  ]