@plugjs/eslint-plugin 0.0.1 → 0.0.3

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,20 @@ 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/order': [ 'error', {
124
+ 'groups': [ 'builtin', 'external', 'internal', [ 'parent', 'sibling' ], 'index', 'object', 'type' ],
125
+ 'newlines-between': 'always',
126
+ 'warnOnUnassignedImports': true,
127
+ } ],
128
+
129
+ // Unicorn extras
130
+ 'unicorn/empty-brace-spaces': 'error',
131
+ 'unicorn/no-instanceof-array': 'error',
132
+ 'unicorn/prefer-node-protocol': 'error',
133
+
103
134
  // Turn off specific JavaScript rules
104
135
  'guard-for-in': [ 'off' ], // no errors on for ... in
105
136
  'no-undef': [ 'off' ], // it'll mark global types as undefs
@@ -109,7 +140,7 @@ module.exports = {
109
140
  'no-invalid-this': [ 'off' ], // use @typescript/no-invalid-this
110
141
  },
111
142
  overrides: [ {
112
- files: [ '*.js' ],
143
+ files: [ '*.js', '*.cjs', '*.mjs' ],
113
144
  parser: 'espree',
114
145
  env: {
115
146
  node: true,
@@ -131,5 +162,16 @@ module.exports = {
131
162
  '@typescript-eslint/no-floating-promises': [ 'off' ],
132
163
  '@typescript-eslint/explicit-function-return-type': [ 'off' ],
133
164
  },
165
+ }, {
166
+ files: [ '*.cjs' ],
167
+ parserOptions: {
168
+ 'sourceType': 'script',
169
+ }
170
+ }, {
171
+ files: [ '*.mjs' ],
172
+ parserOptions: {
173
+ 'sourceType': 'module',
174
+ }
134
175
  } ],
176
+
135
177
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plugjs/eslint-plugin",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
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
  }