@jkba/eslint-config-angular 2.2.0 → 3.1.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.
package/README.md CHANGED
@@ -21,6 +21,7 @@ npm i -D \
21
21
  @eslint/js \
22
22
  typescript-eslint \
23
23
  @smarttools/eslint-plugin-rxjs \
24
+ eslint-plugin-unicorn \
24
25
  @jkba/eslint-config-angular
25
26
 
26
27
  ```
package/eslint.config.js CHANGED
@@ -1,11 +1,13 @@
1
1
  // @ts-check
2
2
 
3
- const eslint = require('@eslint/js');
4
- const tseslint = require('typescript-eslint');
5
- const angular = require('angular-eslint');
6
- const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
7
- const importPlugin = require('eslint-plugin-import');
8
- const rxjs = require('@smarttools/eslint-plugin-rxjs');
3
+ import eslint from '@eslint/js';
4
+ import tseslint from 'typescript-eslint';
5
+ import angular from 'angular-eslint';
6
+ import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
7
+ import * as importPlugin from 'eslint-plugin-import';
8
+ import rxjs from '@smarttools/eslint-plugin-rxjs';
9
+ import eslintPluginUnicorn from 'eslint-plugin-unicorn';
10
+ import globals from 'globals';
9
11
 
10
12
  const config = tseslint.config(
11
13
  {
@@ -120,7 +122,7 @@ const config = tseslint.config(
120
122
  {
121
123
  type: 'attribute',
122
124
  prefix: 'app',
123
- style: 'kebab-case', // I just don't really agree with using camelCase. Material isn't using it neither.
125
+ style: 'kebab-case', // I just don't really agree with using camelCase. Material isn't using it either.
124
126
  },
125
127
  ],
126
128
 
@@ -161,12 +163,23 @@ const config = tseslint.config(
161
163
  '@angular-eslint/template/prefer-control-flow': 'error',
162
164
  },
163
165
  },
166
+ {
167
+ languageOptions: {
168
+ globals: globals.builtin,
169
+ },
170
+ extends: [eslintPluginUnicorn.configs.recommended],
171
+ rules: {
172
+ 'unicorn/prevent-abbreviations': 'off', // I just simply disagree with this rule
173
+ 'unicorn/array-reduce': 'off', // Author of banning reduce belongs to Functional Programming hell
174
+ },
175
+ },
176
+
164
177
  // Prettier rule must always be the very last!
165
178
  // This rule might intentionally disable some rules declared above due to conflicts
166
179
  eslintPluginPrettierRecommended,
167
180
  );
168
181
 
169
- module.exports = config;
182
+ export default config;
170
183
 
171
184
  // notes
172
185
 
package/index.js CHANGED
@@ -1,3 +1,3 @@
1
- const eslintconfig = require('./eslint.config.js');
1
+ import eslintconfig from './eslint.config.js';
2
2
 
3
- module.exports = eslintconfig;
3
+ export default eslintconfig;
package/package.json CHANGED
@@ -1,8 +1,14 @@
1
1
  {
2
2
  "name": "@jkba/eslint-config-angular",
3
- "version": "2.2.0",
3
+ "version": "3.1.1",
4
+ "type": "module",
4
5
  "description": "Opinionated ESLint config for Angular projects",
5
6
  "main": "index.js",
7
+ "exports": {
8
+ ".": "./index.js",
9
+ "./eslint.config": "./eslint.config.js",
10
+ "./prettier.config": "./prettier.config.js"
11
+ },
6
12
  "scripts": {
7
13
  "test": "echo \"Error: no test specified\" && exit 1"
8
14
  },
@@ -42,6 +48,7 @@
42
48
  "prettier": ">=3",
43
49
  "typescript": ">=4",
44
50
  "typescript-eslint": "^8",
45
- "@smarttools/eslint-plugin-rxjs": "^1.0.0"
51
+ "@smarttools/eslint-plugin-rxjs": "^1.0.0",
52
+ "eslint-plugin-unicorn": "^62.0.0"
46
53
  }
47
54
  }
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  singleQuote: true,
3
3
  tabWidth: 2,
4
4
  bracketSameLine: true,
@@ -8,4 +8,4 @@ module.exports = {
8
8
  bracketSpacing: true,
9
9
  printWidth: 100,
10
10
  arrowParens: 'always',
11
- }
11
+ };