@plugjs/eslint-plugin 0.0.2 → 0.0.4

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.
@@ -10,11 +10,27 @@ module.exports = {
10
10
  createDefaultProgram: false,
11
11
  project: [
12
12
  './tsconfig.json',
13
+ './test/tsconfig.json',
13
14
  ],
14
15
  },
15
16
  plugins: [
16
17
  '@typescript-eslint',
18
+ 'import',
19
+ 'unicorn',
17
20
  ],
21
+ // Settings for "eslint-plugin-import"
22
+ settings: {
23
+ 'import/extensions': [ '.ts', '.js', '.mjs', '.cjs' ],
24
+ 'import/external-module-folders': [ 'node_modules', 'node_modules/@types' ],
25
+ 'import/parsers': {
26
+ '@typescript-eslint/parser': [ '.ts' ],
27
+ 'espree': [ '.js', '.mjs', '.cjs' ],
28
+ },
29
+ 'import/resolver': {
30
+ 'typescript': true,
31
+ 'node': true,
32
+ },
33
+ },
18
34
  extends: [
19
35
  'google',
20
36
  'eslint:recommended',
@@ -91,6 +107,7 @@ module.exports = {
91
107
  'valid-jsdoc': [ 'off' ], // nope as well!
92
108
 
93
109
  // TypeScript sanity
110
+ '@typescript-eslint/consistent-type-imports': 'error',
94
111
  '@typescript-eslint/no-unused-vars': [ 'error' ],
95
112
  '@typescript-eslint/no-dupe-class-members': [ 'error' ],
96
113
  '@typescript-eslint/no-invalid-this': [ 'error' ],
@@ -100,6 +117,26 @@ module.exports = {
100
117
  'allowConciseArrowFunctionExpressionsStartingWithVoid': true,
101
118
  } ],
102
119
 
120
+ // Import specifics
121
+ 'import/no-cycle': 'error',
122
+ 'import/no-duplicates': 'error',
123
+ 'import/no-extraneous-dependencies': [ 'error', {
124
+ 'devDependencies': [ 'test' ],
125
+ 'peerDependencies': true,
126
+ 'optionalDependencies': true,
127
+ 'bundledDependencies': false,
128
+ } ],
129
+ 'import/order': [ 'error', {
130
+ 'groups': [ 'builtin', 'external', 'internal', [ 'parent', 'sibling' ], 'index', 'object', 'type' ],
131
+ 'newlines-between': 'always',
132
+ 'warnOnUnassignedImports': true,
133
+ } ],
134
+
135
+ // Unicorn extras
136
+ 'unicorn/empty-brace-spaces': 'error',
137
+ 'unicorn/no-instanceof-array': 'error',
138
+ 'unicorn/prefer-node-protocol': 'error',
139
+
103
140
  // Turn off specific JavaScript rules
104
141
  'guard-for-in': [ 'off' ], // no errors on for ... in
105
142
  'no-undef': [ 'off' ], // it'll mark global types as undefs
@@ -131,5 +168,16 @@ module.exports = {
131
168
  '@typescript-eslint/no-floating-promises': [ 'off' ],
132
169
  '@typescript-eslint/explicit-function-return-type': [ 'off' ],
133
170
  },
171
+ }, {
172
+ files: [ '*.cjs' ],
173
+ parserOptions: {
174
+ 'sourceType': 'script',
175
+ }
176
+ }, {
177
+ files: [ '*.mjs' ],
178
+ parserOptions: {
179
+ 'sourceType': 'module',
180
+ }
134
181
  } ],
182
+
135
183
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plugjs/eslint-plugin",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Shared ESLint configurations and extras",
5
5
  "main": "./index.cjs",
6
6
  "author": "Team Juit <developers@juit.com>",
@@ -10,6 +10,9 @@
10
10
  "@typescript-eslint/parser": ">=5"
11
11
  },
12
12
  "dependencies": {
13
- "eslint-config-google": "^0.14.0"
13
+ "eslint-config-google": "^0.14.0",
14
+ "eslint-import-resolver-typescript": "^3.5.2",
15
+ "eslint-plugin-import": "^2.26.0",
16
+ "eslint-plugin-unicorn": "^44.0.2"
14
17
  }
15
18
  }