@lbenie/linting 1.2.1 → 1.3.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.
@@ -1,42 +1,102 @@
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', '.mjs'],
91
+ },
92
+ rules: {
93
+ ...prettierRules,
94
+ ...tsRules,
95
+ ...functionalrules
34
96
  },
35
97
  env: {
36
98
  browser: true,
37
- node: true,
38
99
  },
39
- plugins: ['prettier', '@typescript-eslint', 'functional', 'jsx-a11y', 'lit-a11y'],
40
100
  },
41
101
  ],
42
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lbenie/linting",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "my opiniated rules",
5
5
  "repository": {
6
6
  "url": "https://github.com/lbenie/linting"
@@ -10,6 +10,7 @@
10
10
  "stylelint",
11
11
  "linting"
12
12
  ],
13
+ "type": "commonjs",
13
14
  "license": "MIT",
14
15
  "private": false,
15
16
  "files": [
@@ -19,7 +20,7 @@
19
20
  "main": "./eslint/.eslintrc.js",
20
21
  "exports": {
21
22
  "./eslint": "./eslint/.eslintrc.js",
22
- "./stylelint": "./stylelint/stylelint.config.cjs"
23
+ "./stylelint": "./stylelint/.stylelintrc.js"
23
24
  },
24
25
  "types": "dist/types/index.d.ts",
25
26
  "scripts": {
@@ -52,6 +53,7 @@
52
53
  "@typescript-eslint/eslint-plugin": "6.5.0",
53
54
  "@typescript-eslint/parser": "6.5.0",
54
55
  "eslint": "8.48.0",
56
+ "eslint-plugin-astro": "^0.29.0",
55
57
  "eslint-plugin-functional": "6.0.0",
56
58
  "eslint-plugin-jsx-a11y": "6.7.1",
57
59
  "eslint-plugin-lit-a11y": "4.1.0",