@chris.araneo/eslint-config 0.0.18 → 0.0.20

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/dist/index.js ADDED
@@ -0,0 +1,98 @@
1
+ import eslint from '@eslint/js';
2
+ import tseslint from 'typescript-eslint';
3
+ import angular from 'angular-eslint';
4
+ import jsonc from 'eslint-plugin-jsonc';
5
+ import simpleImportSort from 'eslint-plugin-simple-import-sort';
6
+ import jsoncParser from 'jsonc-eslint-parser';
7
+ import unicorn from 'eslint-plugin-unicorn';
8
+ import globals from 'globals';
9
+ const DEFAULT_IGNORED_FILES = [
10
+ 'node_modules/',
11
+ 'reports/',
12
+ '.stryker-tmp/',
13
+ '.angular',
14
+ 'package.json',
15
+ 'package-lock.json',
16
+ ];
17
+ export default (jsons = [], sources = [], templates = [], ignored) => {
18
+ return tseslint.config(...jsonc.configs['flat/recommended-with-jsonc'], {
19
+ files: jsons,
20
+ languageOptions: {
21
+ parser: jsoncParser,
22
+ },
23
+ }, {
24
+ files: sources,
25
+ extends: [eslint.configs.all, ...tseslint.configs.all],
26
+ languageOptions: {
27
+ parserOptions: {
28
+ projectService: true,
29
+ tsconfigRootDir: import.meta.dirname,
30
+ },
31
+ },
32
+ rules: {
33
+ '@typescript-eslint/explicit-member-accessibility': [
34
+ 'error',
35
+ {
36
+ accessibility: 'no-public',
37
+ },
38
+ ],
39
+ '@typescript-eslint/init-declarations': 'off',
40
+ '@typescript-eslint/no-extraneous-class': 'off',
41
+ '@typescript-eslint/parameter-properties': 'off',
42
+ 'new-cap': 'off',
43
+ 'no-duplicate-imports': 'off',
44
+ 'one-var': 'off',
45
+ 'sort-imports': 'off',
46
+ 'sort-keys': 'off',
47
+ 'sort-vars': 'off',
48
+ },
49
+ }, {
50
+ files: sources,
51
+ extends: [...angular.configs.tsAll],
52
+ processor: angular.processInlineTemplates,
53
+ rules: {
54
+ '@angular-eslint/component-selector': [
55
+ 'error',
56
+ {
57
+ prefix: 'app',
58
+ style: 'kebab-case',
59
+ type: 'element',
60
+ },
61
+ ],
62
+ '@angular-eslint/directive-selector': [
63
+ 'error',
64
+ {
65
+ prefix: 'app',
66
+ style: 'camelCase',
67
+ type: 'attribute',
68
+ },
69
+ ],
70
+ '@angular-eslint/prefer-on-push-component-change-detection': 'off',
71
+ '@angular-eslint/prefer-signals': 'off',
72
+ '@angular-eslint/template/i18n': 'off',
73
+ },
74
+ }, {
75
+ languageOptions: {
76
+ globals: globals.builtin,
77
+ },
78
+ extends: [unicorn.configs.all],
79
+ }, {
80
+ files: sources,
81
+ plugins: {
82
+ 'simple-import-sort': simpleImportSort,
83
+ },
84
+ rules: {
85
+ 'simple-import-sort/exports': 'error',
86
+ 'simple-import-sort/imports': 'error',
87
+ },
88
+ }, {
89
+ files: templates,
90
+ extends: [...angular.configs.templateAll],
91
+ rules: {
92
+ '@angular-eslint/template/prefer-control-flow': 'off',
93
+ },
94
+ }, {
95
+ ignores: ignored || DEFAULT_IGNORED_FILES,
96
+ });
97
+ };
98
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,YAAY,CAAC;AAChC,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAC9C,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,MAAM,qBAAqB,GAAG;IAC5B,eAAe;IACf,UAAU;IACV,eAAe;IACf,UAAU;IACV,cAAc;IACd,mBAAmB;CACpB,CAAC;AAEF,eAAe,CACb,QAAkB,EAAE,EACpB,UAAoB,EAAE,EACtB,YAAsB,EAAE,EACxB,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,KAAK;SACvC;KACF,EACD;QACE,eAAe,EAAE;YACf,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB;QACD,OAAO,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;KAC/B,EACD;QACE,KAAK,EAAE,OAAO;QACd,OAAO,EAAE;YACP,oBAAoB,EAAE,gBAAgB;SACvC;QACD,KAAK,EAAE;YACL,4BAA4B,EAAE,OAAO;YACrC,4BAA4B,EAAE,OAAO;SACtC;KACF,EACD;QACE,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;QACzC,KAAK,EAAE;YACL,8CAA8C,EAAE,KAAK;SACtD;KACF,EACD;QACE,OAAO,EAAE,OAAO,IAAI,qBAAqB;KAC1C,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"root":["../index.ts"],"version":"5.8.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chris.araneo/eslint-config",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "eslint",
@@ -14,14 +14,18 @@
14
14
  "license": "MIT",
15
15
  "author": "Krzysztof Pająk (Chris Araneo) <chris.araneo@gmail.com>",
16
16
  "type": "module",
17
- "main": "./index.mjs",
17
+ "main": "./dist/index.js",
18
+ "module": "./dist/index.mjs",
19
+ "types": "./dist/index.d.ts",
18
20
  "files": [
19
- "./index.mjs"
21
+ "dist/**"
20
22
  ],
21
23
  "scripts": {
24
+ "build": "tsc --build tsconfig.json",
22
25
  "format": "npx sort-package-json && prettier --write ."
23
26
  },
24
27
  "dependencies": {
28
+ "@humanwhocodes/momoa": "^3.3.8",
25
29
  "angular-eslint": "^19.4.0",
26
30
  "eslint": "^9.27.0",
27
31
  "eslint-plugin-jsonc": "^2.20.1",
@@ -31,7 +35,8 @@
31
35
  "typescript-eslint": "^8.32.1"
32
36
  },
33
37
  "devDependencies": {
34
- "prettier": "^3.5.3"
38
+ "prettier": "^3.5.3",
39
+ "typescript": "^5.8.3"
35
40
  },
36
41
  "publishConfig": {
37
42
  "access": "public"
package/index.mjs DELETED
@@ -1,98 +0,0 @@
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
- import globals from 'globals';
9
-
10
- export default (jsonFiles, sourceFiles, htmlFiles, ignoredFiles) => {
11
- return tseslint.config(
12
- ...eslintPluginJsonc.configs['flat/recommended-with-jsonc'],
13
- {
14
- files: jsonFiles,
15
- languageOptions: {
16
- parser: jsoncParser,
17
- },
18
- },
19
- {
20
- files: sourceFiles,
21
- extends: [eslint.configs.all, ...tseslint.configs.all],
22
- languageOptions: {
23
- parserOptions: {
24
- projectService: true,
25
- tsconfigRootDir: import.meta.dirname,
26
- },
27
- },
28
- rules: {
29
- 'new-cap': 'off',
30
- 'sort-imports': 'off',
31
- 'sort-keys': 'off',
32
- '@typescript-eslint/init-declarations': 'off',
33
- '@typescript-eslint/parameter-properties': 'off',
34
- '@typescript-eslint/explicit-member-accessibility': [
35
- 'error',
36
- {
37
- accessibility: 'no-public',
38
- },
39
- ],
40
- '@typescript-eslint/no-extraneous-class': 'off',
41
- },
42
- },
43
- {
44
- files: sourceFiles,
45
- extends: [...angular.configs.tsAll],
46
- processor: angular.processInlineTemplates,
47
- rules: {
48
- '@angular-eslint/directive-selector': [
49
- 'error',
50
- {
51
- type: 'attribute',
52
- prefix: 'app',
53
- style: 'camelCase',
54
- },
55
- ],
56
- '@angular-eslint/component-selector': [
57
- 'error',
58
- {
59
- type: 'element',
60
- prefix: 'app',
61
- style: 'kebab-case',
62
- },
63
- ],
64
- '@angular-eslint/template/prefer-control-flow': 'off',
65
- },
66
- },
67
- {
68
- languageOptions: {
69
- globals: globals.builtin,
70
- },
71
- extends: [eslintPluginUnicorn.configs.all],
72
- },
73
- {
74
- files: sourceFiles,
75
- plugins: {
76
- 'simple-import-sort': simpleImportSort,
77
- },
78
- rules: {
79
- 'simple-import-sort/imports': 'error',
80
- 'simple-import-sort/exports': 'error',
81
- },
82
- },
83
- {
84
- files: htmlFiles,
85
- extends: [...angular.configs.templateAll],
86
- },
87
- {
88
- ignores: ignoredFiles || [
89
- 'node_modules/',
90
- 'reports/',
91
- '.stryker-tmp/',
92
- '.angular',
93
- 'package.json',
94
- 'package-lock.json',
95
- ],
96
- },
97
- );
98
- };