@chris.araneo/eslint-config 0.0.14 → 0.0.16

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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.mjs +83 -70
  3. package/package.json +6 -2
package/README.md CHANGED
@@ -1 +1 @@
1
- # @chris.araneo/eslint-config
1
+ # @chris.araneo/eslint-config
package/index.mjs CHANGED
@@ -1,70 +1,83 @@
1
- import eslint from "@eslint/js";
2
- import tseslint from "typescript-eslint";
3
- import angular from "angular-eslint";
4
- import eslintPluginJsonc from "eslint-plugin-jsonc";
5
- import simpleImportSort from "eslint-plugin-simple-import-sort";
6
- import jsoncParser from "jsonc-eslint-parser";
7
-
8
- export default function createConfig(jsonFiles, sourceFiles, htmlFiles) {
9
- return tseslint.config(
10
- ...eslintPluginJsonc.configs["flat/recommended-with-jsonc"],
11
- {
12
- files: jsonFiles,
13
- languageOptions: {
14
- parser: jsoncParser,
15
- },
16
- },
17
- {
18
- files: sourceFiles,
19
- extends: [
20
- eslint.configs.all,
21
- ...tseslint.configs.all,
22
- ...angular.configs.tsAll,
23
- ],
24
- processor: angular.processInlineTemplates,
25
- rules: {
26
- "@angular-eslint/directive-selector": [
27
- "error",
28
- {
29
- type: "attribute",
30
- prefix: "app",
31
- style: "camelCase",
32
- },
33
- ],
34
- "@angular-eslint/component-selector": [
35
- "error",
36
- {
37
- type: "element",
38
- prefix: "app",
39
- style: "kebab-case",
40
- },
41
- ],
42
- "@typescript-eslint/no-extraneous-class": "off",
43
- },
44
- },
45
- {
46
- files: sourceFiles,
47
- plugins: {
48
- "simple-import-sort": simpleImportSort,
49
- },
50
- rules: {
51
- "simple-import-sort/imports": "error",
52
- "simple-import-sort/exports": "error",
53
- },
54
- },
55
- {
56
- files: htmlFiles,
57
- extends: [...angular.configs.templateAll],
58
- },
59
- {
60
- ignores: [
61
- "node_modules/",
62
- "reports/",
63
- ".stryker-tmp/",
64
- ".angular",
65
- "package.json",
66
- "package-lock.json",
67
- ],
68
- }
69
- );
70
- }
1
+ import eslint from '@eslint/js';
2
+ import tseslint from 'typescript-eslint';
3
+ import angular from 'angular-eslint';
4
+ import eslintPluginJsonc from 'eslint-plugin-jsonc';
5
+ import simpleImportSort from 'eslint-plugin-simple-import-sort';
6
+ import jsoncParser from 'jsonc-eslint-parser';
7
+ import eslintPluginUnicorn from 'eslint-plugin-unicorn';
8
+
9
+ export default (jsonFiles, sourceFiles, htmlFiles, ignoredFiles) => {
10
+ return tseslint.config(
11
+ ...eslintPluginJsonc.configs['flat/recommended-with-jsonc'],
12
+ {
13
+ files: jsonFiles,
14
+ languageOptions: {
15
+ parser: jsoncParser,
16
+ },
17
+ },
18
+ {
19
+ files: sourceFiles,
20
+ extends: [eslint.configs.all, ...tseslint.configs.all],
21
+ languageOptions: {
22
+ parserOptions: {
23
+ projectService: true,
24
+ tsconfigRootDir: import.meta.dirname,
25
+ },
26
+ },
27
+ },
28
+ {
29
+ files: sourceFiles,
30
+ extends: [...angular.configs.tsAll],
31
+ processor: angular.processInlineTemplates,
32
+ rules: {
33
+ '@angular-eslint/directive-selector': [
34
+ 'error',
35
+ {
36
+ type: 'attribute',
37
+ prefix: 'app',
38
+ style: 'camelCase',
39
+ },
40
+ ],
41
+ '@angular-eslint/component-selector': [
42
+ 'error',
43
+ {
44
+ type: 'element',
45
+ prefix: 'app',
46
+ style: 'kebab-case',
47
+ },
48
+ ],
49
+ '@typescript-eslint/no-extraneous-class': 'off',
50
+ },
51
+ },
52
+ {
53
+ languageOptions: {
54
+ globals: globals.builtin,
55
+ },
56
+ extends: [eslintPluginUnicorn.configs.all],
57
+ },
58
+ {
59
+ files: sourceFiles,
60
+ plugins: {
61
+ 'simple-import-sort': simpleImportSort,
62
+ },
63
+ rules: {
64
+ 'simple-import-sort/imports': 'error',
65
+ 'simple-import-sort/exports': 'error',
66
+ },
67
+ },
68
+ {
69
+ files: htmlFiles,
70
+ extends: [...angular.configs.templateAll],
71
+ },
72
+ {
73
+ ignores: ignoredFiles || [
74
+ 'node_modules/',
75
+ 'reports/',
76
+ '.stryker-tmp/',
77
+ '.angular',
78
+ 'package.json',
79
+ 'package-lock.json',
80
+ ],
81
+ },
82
+ );
83
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chris.araneo/eslint-config",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "eslint",
@@ -19,16 +19,20 @@
19
19
  "./index.mjs"
20
20
  ],
21
21
  "scripts": {
22
- "format": "npx sort-package-json"
22
+ "format": "npx sort-package-json && prettier --write ."
23
23
  },
24
24
  "dependencies": {
25
25
  "angular-eslint": "^19.4.0",
26
26
  "eslint": "^9.27.0",
27
27
  "eslint-plugin-jsonc": "^2.20.1",
28
28
  "eslint-plugin-simple-import-sort": "^12.1.1",
29
+ "eslint-plugin-unicorn": "^59.0.1",
29
30
  "jsonc-eslint-parser": "^2.4.0",
30
31
  "typescript-eslint": "^8.32.1"
31
32
  },
33
+ "devDependencies": {
34
+ "prettier": "^3.5.3"
35
+ },
32
36
  "publishConfig": {
33
37
  "access": "public"
34
38
  }