@lbenie/linting 1.2.2 → 1.3.1

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.
Files changed (2) hide show
  1. package/eslint/.eslintrc.js +78 -19
  2. package/package.json +2 -1
@@ -1,42 +1,101 @@
1
1
  /**
2
- * @type {import('eslint').CLIEngine.Options}
2
+ * @type {import('eslint').Linter.Config['rules']}
3
+ */
4
+ const tsRules = {
5
+ '@typescript-eslint/no-unused-vars': 'off',
6
+ '@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports'}],
7
+ '@typescript-eslint/prefer-readonly': ['error'],
8
+ '@typescript-eslint/prefer-readonly-parameter-types': ['error'],
9
+ }
10
+
11
+ /**
12
+ * @type {import('eslint').Linter.Config['rules']}
13
+ */
14
+ const functionalrules = {
15
+ 'functional/prefer-tacit': ['error'],
16
+ 'functional/prefer-readonly-type': ['error'],
17
+ 'functional/readonly-type': ['error'],
18
+ 'functional/prefer-property-signatures': ['error'],
19
+ }
20
+
21
+ /**
22
+ * @type {import('eslint').Linter.Config['rules']}
23
+ */
24
+ const prettierRules = {
25
+ 'prettier/prettier': [
26
+ 'error',
27
+ { singleQuote: true, semi: false, trailingComma: 'all' },
28
+ ]
29
+ }
30
+
31
+ /**
32
+ * @type {import('eslint').Linter.Config['extends']}
33
+ */
34
+ const a11yExtends = [
35
+ 'plugin:jsx-a11y/recommended',
36
+ 'plugin:lit-a11y/recommended',
37
+ ]
38
+
39
+ /**
40
+ * @type {import('eslint').Linter.Config}
3
41
  */
4
42
  module.exports = {
5
43
  root: true,
44
+ extends: [
45
+ 'eslint:recommended',
46
+ ],
47
+ plugins: ['prettier', '@typescript-eslint', 'functional', 'jsx-a11y', 'lit-a11y'],
48
+ env: {
49
+ node: true,
50
+ es6: true,
51
+ },
52
+ parserOptions: {
53
+ ecmaVersion: 'latest',
54
+ sourceType: 'module',
55
+ experimentalObjectRestSpread: true,
56
+ },
6
57
  overrides: [
7
58
  {
8
- files: ['*.ts', '*.tsx'],
59
+ files: ['*.ts', '*.tsx', '*.mjs', '*.cjs'],
9
60
  extends: [
10
- 'eslint:recommended',
11
61
  'plugin:@typescript-eslint/recommended',
12
62
  'plugin:@typescript-eslint/recommended-requiring-type-checking',
13
- 'plugin:jsx-a11y/recommended',
14
- 'plugin:lit-a11y/recommended',
63
+ ...a11yExtends,
15
64
  ],
16
65
  parserOptions: {
17
66
  parser: '@typescript-eslint/parser',
18
67
  project: ['./tsconfig.json'],
19
- sourceType: 'module',
68
+ ecmaFeatures: {
69
+ jsx: true,
70
+ }
20
71
  },
21
72
  parser: '@typescript-eslint/parser',
22
73
  rules: {
23
- 'prettier/prettier': [
24
- 'error',
25
- { singleQuote: true, semi: false, trailingComma: 'all' },
26
- ],
27
- '@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports'}],
28
- '@typescript-eslint/prefer-readonly': ['error'],
29
- '@typescript-eslint/prefer-readonly-parameter-types': ['error'],
30
- 'functional/prefer-tacit': ['error'],
31
- 'functional/prefer-readonly-type': ['error'],
32
- 'functional/readonly-type': ['error'],
33
- 'functional/prefer-property-signatures': ['error'],
74
+ ...prettierRules,
75
+ ...tsRules,
76
+ ...functionalrules
77
+ },
78
+ env: {
79
+ browser: true,
80
+ },
81
+ },
82
+ {
83
+ files: ['*.astro'],
84
+ parser: 'astro-eslint-parser',
85
+ extends: [
86
+ ...a11yExtends,
87
+ 'plugin:astro/recommended'
88
+ ],
89
+ parserOptions: {
90
+ extraFileExtensions: ['.astro'],
91
+ },
92
+ rules: {
93
+ ...tsRules,
94
+ ...functionalrules
34
95
  },
35
96
  env: {
36
97
  browser: true,
37
- node: true,
38
98
  },
39
- plugins: ['prettier', '@typescript-eslint', 'functional', 'jsx-a11y', 'lit-a11y'],
40
99
  },
41
100
  ],
42
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lbenie/linting",
3
- "version": "1.2.2",
3
+ "version": "1.3.1",
4
4
  "description": "my opiniated rules",
5
5
  "repository": {
6
6
  "url": "https://github.com/lbenie/linting"
@@ -53,6 +53,7 @@
53
53
  "@typescript-eslint/eslint-plugin": "6.5.0",
54
54
  "@typescript-eslint/parser": "6.5.0",
55
55
  "eslint": "8.48.0",
56
+ "eslint-plugin-astro": "^0.29.0",
56
57
  "eslint-plugin-functional": "6.0.0",
57
58
  "eslint-plugin-jsx-a11y": "6.7.1",
58
59
  "eslint-plugin-lit-a11y": "4.1.0",