eslint-config-gristow 2.0.14 → 2.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.
package/.eslintrc.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  const rules = require('./rules/shared-rules.cjs');
2
2
  const importRules = require('./rules/import-rules.js');
3
+ const typescriptOnlyRules = require('./rules/typescript-only-rules.cjs');
3
4
 
4
5
  module.exports = {
5
6
  root: true,
@@ -33,4 +34,8 @@ module.exports = {
33
34
  es2017: true,
34
35
  node: true,
35
36
  },
37
+ overrides: {
38
+ files: ['*.ts'],
39
+ rules: typescriptOnlyRules,
40
+ },
36
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-gristow",
3
- "version": "2.0.14",
3
+ "version": "2.0.16",
4
4
  "description": "Eslint settings for Greg Ristow",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -83,7 +83,8 @@ module.exports = {
83
83
  'no-redeclare': 'off',
84
84
  '@typescript-eslint/no-redeclare': 'error',
85
85
  // Enabled by airbnb -- but we use literal throws extensively, and intentionally, in /backend
86
- 'no-throw-literal': 'off',
86
+ // so we override this there.
87
+ 'no-throw-literal': 'on',
87
88
  '@typescript-eslint/no-throw-literal': 'off',
88
89
  'no-useless-constructor': 'off',
89
90
  '@typescript-eslint/no-useless-constructor': 'error',
@@ -102,4 +103,5 @@ module.exports = {
102
103
  // }],
103
104
  camelcase: 'off',
104
105
  ...namingConvention,
106
+ '@typescript-eslint/no-unnecessary-condition': ['warn'],
105
107
  };
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ // Everything we get in .js from this, we get in .ts for free. And, if we
3
+ // add this, we can't hoist type definitions any more.
4
+ 'no-use-before-define': 'off',
5
+ };
package/test.ts CHANGED
@@ -56,3 +56,9 @@ console.log(a);
56
56
  throw 'hello';
57
57
 
58
58
  console.log('unreachable code error!');
59
+
60
+ later();
61
+
62
+ function later() {
63
+ return 'later';
64
+ }