Repository: stoplightio/spectral
Pull request #294 (2019-07-05 16:02:33)

feat: rename rules.json to index.json
### Please check if the PR fulfills these requirements
- [x] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)

### What kind of change does this PR introduce?

Revert of reverted change in #232.

### What is the current behavior?



### If this is a feature change, what is the new behavior?



### Does this PR introduce a breaking change?



What changes might users need to make in their application due to this PR?

### Other information

(e.g. detailed explanation, related issues, links for us to have context, eg. stackoverflow, issues outside of the repo, forum, etc.)



Patch:
diff --git a/jest.config.js b/jest.config.js
index 611a5ff5..f4dbb2a6 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -1,5 +1,6 @@
 module.exports = {
   preset: 'ts-jest',
+  moduleFileExtensions: ['ts', 'tsx', 'js'],
   testEnvironment: 'node',
   testMatch: ['<rootDir>/src/**/__tests__/*.(ts)'],
 };
diff --git a/src/rulesets/index.ts b/src/rulesets/index.ts
index 2dc0133d..914facd6 100644
--- a/src/rulesets/index.ts
+++ b/src/rulesets/index.ts
@@ -1,7 +1,7 @@
 import { oas2Functions } from './oas2';
-import * as oas2Ruleset from './oas2/rules.json';
+import * as oas2Ruleset from './oas2/index.json';
 import { oas3Functions } from './oas3';
-import * as oas3Ruleset from './oas3/rules.json';
+import * as oas3Ruleset from './oas3/index.json';
 
 const merge = require('lodash/merge');
 
diff --git a/src/rulesets/map.ts b/src/rulesets/map.ts
index 6ef8b0c9..b1d7b371 100644
--- a/src/rulesets/map.ts
+++ b/src/rulesets/map.ts
@@ -1,5 +1,5 @@
 function resolveSpectralRuleset(ruleset: string) {
-  return `@stoplight/spectral/rulesets/${ruleset}/rules.json`;
+  return `@stoplight/spectral/rulesets/${ruleset}/index.json`;
 }
 export const rulesetsMap = new Map<string, string>([
   ['spectral:oas', resolveSpectralRuleset('oas')],
diff --git a/src/rulesets/oas/rules.json b/src/rulesets/oas/index.json
similarity index 100%
rename from src/rulesets/oas/rules.json
rename to src/rulesets/oas/index.json
diff --git a/src/rulesets/oas/index.ts b/src/rulesets/oas/index.ts
index be02e7af..397108df 100644
--- a/src/rulesets/oas/index.ts
+++ b/src/rulesets/oas/index.ts
@@ -12,4 +12,4 @@ export const commonOasFunctions = (): FunctionCollection => {
   };
 };
 
-export const rules = async () => readRulesFromRulesets(require.resolve('./rules.json'));
+export const rules = async () => readRulesFromRulesets(require.resolve('./index.json'));
diff --git a/src/rulesets/oas2/rules.json b/src/rulesets/oas2/index.json
similarity index 100%
rename from src/rulesets/oas2/rules.json
rename to src/rulesets/oas2/index.json
diff --git a/src/rulesets/oas2/index.ts b/src/rulesets/oas2/index.ts
index 009a0193..d371dd33 100644
--- a/src/rulesets/oas2/index.ts
+++ b/src/rulesets/oas2/index.ts
@@ -2,4 +2,4 @@ import { readRulesFromRulesets } from '../reader';
 
 export { commonOasFunctions as oas2Functions } from '../oas';
 
-export const rules = async () => readRulesFromRulesets(require.resolve('./rules.json'));
+export const rules = async () => readRulesFromRulesets(require.resolve('./index.json'));
diff --git a/src/rulesets/oas3/rules.json b/src/rulesets/oas3/index.json
similarity index 100%
rename from src/rulesets/oas3/rules.json
rename to src/rulesets/oas3/index.json
diff --git a/src/rulesets/oas3/index.ts b/src/rulesets/oas3/index.ts
index ddb9b671..0a02a19e 100644
--- a/src/rulesets/oas3/index.ts
+++ b/src/rulesets/oas3/index.ts
@@ -2,4 +2,4 @@ import { readRulesFromRulesets } from '../reader';
 
 export { commonOasFunctions as oas3Functions } from '../oas';
 
-export const rules = async () => readRulesFromRulesets(require.resolve('./rules.json'));
+export const rules = async () => readRulesFromRulesets(require.resolve('./index.json'));


Test patch:
diff --git a/src/__tests__/linter.test.ts b/src/__tests__/linter.test.ts
index 14922572..e4063abd 100644
--- a/src/__tests__/linter.test.ts
+++ b/src/__tests__/linter.test.ts
@@ -4,9 +4,9 @@ import * as fs from 'fs';
 import { cloneDeep } from 'lodash';
 import { mergeRulesets } from '../rulesets/merger';
 import { oas2Functions } from '../rulesets/oas2';
-import * as oas2Ruleset from '../rulesets/oas2/rules.json';
+import * as oas2Ruleset from '../rulesets/oas2/index.json';
 import { oas3Functions } from '../rulesets/oas3';
-import * as oas3Ruleset from '../rulesets/oas3/rules.json';
+import * as oas3Ruleset from '../rulesets/oas3/index.json';
 import { Spectral } from '../spectral';
 import { RuleCollection } from '../types';
 import { IRulesetFile } from '../types/ruleset';
diff --git a/src/cli/commands/__tests__/lint.test.ts b/src/cli/commands/__tests__/lint.test.ts
index ea80bf2a..9f93704a 100644
--- a/src/cli/commands/__tests__/lint.test.ts
+++ b/src/cli/commands/__tests__/lint.test.ts
@@ -11,8 +11,8 @@ const invalidRulesetPath = resolve(__dirname, '__fixtures__/ruleset-invalid.yaml
 const validRulesetPath = resolve(__dirname, '__fixtures__/ruleset-valid.yaml');
 const validNestedRulesetPath = resolve(__dirname, '__fixtures__/ruleset-extends-valid.yaml');
 const invalidNestedRulesetPath = resolve(__dirname, '__fixtures__/ruleset-extends-invalid.yaml');
-const standardOas3RulesetPath = resolve(__dirname, '../../../rulesets/oas3/rules.json');
-const standardOas2RulesetPath = resolve(__dirname, '../../../rulesets/oas2/rules.json');
+const standardOas3RulesetPath = resolve(__dirname, '../../../rulesets/oas3/index.json');
+const standardOas2RulesetPath = resolve(__dirname, '../../../rulesets/oas2/index.json');
 const draftRefSpec = resolve(__dirname, './__fixtures__/draft-ref.oas2.json');
 const draftNestedRefSpec = resolve(__dirname, './__fixtures__/draft-nested-ref.oas2.json');
 
diff --git a/src/rulesets/__tests__/finder.test.ts b/src/rulesets/__tests__/finder.test.ts
index 0eb64b09..a47bc0d6 100644
--- a/src/rulesets/__tests__/finder.test.ts
+++ b/src/rulesets/__tests__/finder.test.ts
@@ -29,14 +29,14 @@ describe('Rulesets finder', () => {
   });
 
   it('should support spectral built-in rules', () => {
-    return expect(findRuleset('/b/c/d', '@stoplight/spectral/rulesets/oas2/rules.json')).resolves.toEqual(
-      path.join(process.cwd(), 'src/rulesets/oas2/rules.json'),
+    return expect(findRuleset('/b/c/d', '@stoplight/spectral/rulesets/oas2/index.json')).resolves.toEqual(
+      path.join(process.cwd(), 'src/rulesets/oas2/index.json'),
     );
   });
 
   it.each(['oas', 'oas2', 'oas3'])('should support spectral built-in %s ruleset shorthand', shorthand => {
     return expect(findRuleset('', `spectral:${shorthand}`)).resolves.toEqual(
-      path.join(process.cwd(), `src/rulesets/${shorthand}/rules.json`),
+      path.join(process.cwd(), `src/rulesets/${shorthand}/index.json`),
     );
   });
 
diff --git a/src/rulesets/__tests__/reader.test.ts b/src/rulesets/__tests__/reader.test.ts
index 080662b0..bce1db89 100644
--- a/src/rulesets/__tests__/reader.test.ts
+++ b/src/rulesets/__tests__/reader.test.ts
@@ -9,8 +9,8 @@ const validFlatRuleset2 = path.join(__dirname, './__fixtures__/valid-require-inf
 const invalidRuleset = path.join(__dirname, './__fixtures__/invalid-ruleset.json');
 const extendsOas2Ruleset = path.join(__dirname, './__fixtures__/extends-oas2-ruleset.json');
 const extendsOas2WithOverrideRuleset = path.join(__dirname, './__fixtures__/extends-oas2-with-override-ruleset.json');
-const oasRuleset = require('../oas/rules.json');
-const oas2Ruleset = require('../oas2/rules.json');
+const oasRuleset = require('../oas/index.json');
+const oas2Ruleset = require('../oas2/index.json');
 
 describe('Rulesets reader', () => {
   it('given flat, valid ruleset file should return rules', async () => {
diff --git a/src/rulesets/oas/__tests__/contact-properties.ts b/src/rulesets/oas/__tests__/contact-properties.ts
index 2e4f1b22..d17b9ec2 100644
--- a/src/rulesets/oas/__tests__/contact-properties.ts
+++ b/src/rulesets/oas/__tests__/contact-properties.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('contact-properties', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/example-value-or-externalValue.ts b/src/rulesets/oas/__tests__/example-value-or-externalValue.ts
index ecc6ee1e..17651b6e 100644
--- a/src/rulesets/oas/__tests__/example-value-or-externalValue.ts
+++ b/src/rulesets/oas/__tests__/example-value-or-externalValue.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('example-value-or-externalValue', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/info-contact.ts b/src/rulesets/oas/__tests__/info-contact.ts
index 75455c86..77fee866 100644
--- a/src/rulesets/oas/__tests__/info-contact.ts
+++ b/src/rulesets/oas/__tests__/info-contact.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('info-contact', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/info-description.ts b/src/rulesets/oas/__tests__/info-description.ts
index 70ab055f..1eef921e 100644
--- a/src/rulesets/oas/__tests__/info-description.ts
+++ b/src/rulesets/oas/__tests__/info-description.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('info-description', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/info-license.ts b/src/rulesets/oas/__tests__/info-license.ts
index 1d55bc0b..3cfa17f2 100644
--- a/src/rulesets/oas/__tests__/info-license.ts
+++ b/src/rulesets/oas/__tests__/info-license.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('info-license', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/license-url.ts b/src/rulesets/oas/__tests__/license-url.ts
index a9756eca..2cf3b921 100644
--- a/src/rulesets/oas/__tests__/license-url.ts
+++ b/src/rulesets/oas/__tests__/license-url.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('license-url', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/no-eval-in-markdown.ts b/src/rulesets/oas/__tests__/no-eval-in-markdown.ts
index db83cefd..d3a100de 100644
--- a/src/rulesets/oas/__tests__/no-eval-in-markdown.ts
+++ b/src/rulesets/oas/__tests__/no-eval-in-markdown.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('no-eval-in-markdown', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/no-script-tags-in-markdown.ts b/src/rulesets/oas/__tests__/no-script-tags-in-markdown.ts
index 3bc259d5..bdfa275e 100644
--- a/src/rulesets/oas/__tests__/no-script-tags-in-markdown.ts
+++ b/src/rulesets/oas/__tests__/no-script-tags-in-markdown.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('no-script-tags-in-markdown', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/only-local-references.ts b/src/rulesets/oas/__tests__/only-local-references.ts
index 0b59cb75..53cf9df6 100644
--- a/src/rulesets/oas/__tests__/only-local-references.ts
+++ b/src/rulesets/oas/__tests__/only-local-references.ts
@@ -1,6 +1,6 @@
 import { DiagnosticSeverity } from '@stoplight/types';
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('only-local-references', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/openapi-tags-alphabetical.ts b/src/rulesets/oas/__tests__/openapi-tags-alphabetical.ts
index 76ac823a..edd7c6b0 100644
--- a/src/rulesets/oas/__tests__/openapi-tags-alphabetical.ts
+++ b/src/rulesets/oas/__tests__/openapi-tags-alphabetical.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('openapi-tags-alphabetical', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/openapi-tags.ts b/src/rulesets/oas/__tests__/openapi-tags.ts
index db1d6bdc..d0e525f9 100644
--- a/src/rulesets/oas/__tests__/openapi-tags.ts
+++ b/src/rulesets/oas/__tests__/openapi-tags.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('openapi-tags', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/operation-2xx-response.ts b/src/rulesets/oas/__tests__/operation-2xx-response.ts
index bc55657b..2534c21c 100644
--- a/src/rulesets/oas/__tests__/operation-2xx-response.ts
+++ b/src/rulesets/oas/__tests__/operation-2xx-response.ts
@@ -1,6 +1,6 @@
 import { commonOasFunctions } from '../';
 import { Spectral } from '../../../spectral';
-import { rules } from '../rules.json';
+import { rules } from '../index.json';
 
 const { oasOp2xxResponse } = commonOasFunctions();
 
diff --git a/src/rulesets/oas/__tests__/operation-default-response.ts b/src/rulesets/oas/__tests__/operation-default-response.ts
index e51f2a01..c6b11bf6 100644
--- a/src/rulesets/oas/__tests__/operation-default-response.ts
+++ b/src/rulesets/oas/__tests__/operation-default-response.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('operation-default-response', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/operation-description.ts b/src/rulesets/oas/__tests__/operation-description.ts
index 7dc9ed55..b1e073e6 100644
--- a/src/rulesets/oas/__tests__/operation-description.ts
+++ b/src/rulesets/oas/__tests__/operation-description.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('operation-description', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/operation-operationId-valid-in-url.ts b/src/rulesets/oas/__tests__/operation-operationId-valid-in-url.ts
index bf5f2293..1c5b4e15 100644
--- a/src/rulesets/oas/__tests__/operation-operationId-valid-in-url.ts
+++ b/src/rulesets/oas/__tests__/operation-operationId-valid-in-url.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('operation-operationId-valid-in-url', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/operation-operationId.ts b/src/rulesets/oas/__tests__/operation-operationId.ts
index fb7c15f6..c6ef1ba9 100644
--- a/src/rulesets/oas/__tests__/operation-operationId.ts
+++ b/src/rulesets/oas/__tests__/operation-operationId.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('operation-operationId', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/operation-singular-tag.ts b/src/rulesets/oas/__tests__/operation-singular-tag.ts
index 43219296..4149465a 100644
--- a/src/rulesets/oas/__tests__/operation-singular-tag.ts
+++ b/src/rulesets/oas/__tests__/operation-singular-tag.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('operation-singular-tag', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/operation-summary-formatted.ts b/src/rulesets/oas/__tests__/operation-summary-formatted.ts
index e478e8f3..c6af41ce 100644
--- a/src/rulesets/oas/__tests__/operation-summary-formatted.ts
+++ b/src/rulesets/oas/__tests__/operation-summary-formatted.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('operation-summary-formatted', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/operation-tags.ts b/src/rulesets/oas/__tests__/operation-tags.ts
index be0be643..989bbb8f 100644
--- a/src/rulesets/oas/__tests__/operation-tags.ts
+++ b/src/rulesets/oas/__tests__/operation-tags.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('operation-tags', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/parameter-description.ts b/src/rulesets/oas/__tests__/parameter-description.ts
index b5d22204..8cd48112 100644
--- a/src/rulesets/oas/__tests__/parameter-description.ts
+++ b/src/rulesets/oas/__tests__/parameter-description.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('parameter-description', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/path-declarations-must-exist.ts b/src/rulesets/oas/__tests__/path-declarations-must-exist.ts
index ca112f6f..c41390ad 100644
--- a/src/rulesets/oas/__tests__/path-declarations-must-exist.ts
+++ b/src/rulesets/oas/__tests__/path-declarations-must-exist.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('path-declarations-must-exist', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/path-keys-no-trailing-slash.ts b/src/rulesets/oas/__tests__/path-keys-no-trailing-slash.ts
index acbb6f0a..246e53a7 100644
--- a/src/rulesets/oas/__tests__/path-keys-no-trailing-slash.ts
+++ b/src/rulesets/oas/__tests__/path-keys-no-trailing-slash.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('path-keys-no-trailing-slash', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/path-not-include-query.ts b/src/rulesets/oas/__tests__/path-not-include-query.ts
index 2844e008..e7fe087e 100644
--- a/src/rulesets/oas/__tests__/path-not-include-query.ts
+++ b/src/rulesets/oas/__tests__/path-not-include-query.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('path-not-include-query', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/__tests__/tag-description.ts b/src/rulesets/oas/__tests__/tag-description.ts
index 1acbaa23..2d167c1e 100644
--- a/src/rulesets/oas/__tests__/tag-description.ts
+++ b/src/rulesets/oas/__tests__/tag-description.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('tag-description', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas/functions/oasOp2xxResponse/__tests__/index.ts b/src/rulesets/oas/functions/oasOp2xxResponse/__tests__/index.ts
index 1a4e06f2..1142ee78 100644
--- a/src/rulesets/oas/functions/oasOp2xxResponse/__tests__/index.ts
+++ b/src/rulesets/oas/functions/oasOp2xxResponse/__tests__/index.ts
@@ -1,6 +1,6 @@
 import { RuleType, Spectral } from '../../../../../spectral';
 import { commonOasFunctions } from '../../../../oas/index';
-import { rules } from '../../../../oas/rules.json';
+import { rules } from '../../../../oas/index.json';
 const ruleset = { functions: commonOasFunctions(), rules };
 
 describe('oasOp2xxResponse', () => {
diff --git a/src/rulesets/oas/functions/oasOpFormDataConsumeCheck/__tests__/index.ts b/src/rulesets/oas/functions/oasOpFormDataConsumeCheck/__tests__/index.ts
index 6f14f3c0..ed6a6128 100644
--- a/src/rulesets/oas/functions/oasOpFormDataConsumeCheck/__tests__/index.ts
+++ b/src/rulesets/oas/functions/oasOpFormDataConsumeCheck/__tests__/index.ts
@@ -1,7 +1,7 @@
 import { RuleType, Spectral } from '../../../../../index';
 import { commonOasFunctions } from '../../../index';
 
-import { rules } from '../../../rules.json';
+import { rules } from '../../../index.json';
 
 const ruleset = { functions: commonOasFunctions(), rules };
 
diff --git a/src/rulesets/oas/functions/oasOpIdUnique/__tests__/index.ts b/src/rulesets/oas/functions/oasOpIdUnique/__tests__/index.ts
index 997c3122..1dc732f9 100644
--- a/src/rulesets/oas/functions/oasOpIdUnique/__tests__/index.ts
+++ b/src/rulesets/oas/functions/oasOpIdUnique/__tests__/index.ts
@@ -1,7 +1,7 @@
 import { RuleType, Spectral } from '../../../../../index';
 import { commonOasFunctions } from '../../../index';
 
-import { rules } from '../../../rules.json';
+import { rules } from '../../../index.json';
 
 const ruleset = { functions: commonOasFunctions(), rules };
 
diff --git a/src/rulesets/oas/functions/oasOpParams/__tests__/index.test.ts b/src/rulesets/oas/functions/oasOpParams/__tests__/index.test.ts
index 3d80321f..4081074a 100644
--- a/src/rulesets/oas/functions/oasOpParams/__tests__/index.test.ts
+++ b/src/rulesets/oas/functions/oasOpParams/__tests__/index.test.ts
@@ -1,7 +1,7 @@
 import { RuleType, Spectral } from '../../../../../index';
 import { commonOasFunctions } from '../../../index';
 
-import { rules } from '../../../rules.json';
+import { rules } from '../../../index.json';
 
 const ruleset = { functions: commonOasFunctions(), rules };
 
diff --git a/src/rulesets/oas/functions/oasOpSecurityDefined/__tests__/index.ts b/src/rulesets/oas/functions/oasOpSecurityDefined/__tests__/index.ts
index 2252f7cc..b98c0e53 100644
--- a/src/rulesets/oas/functions/oasOpSecurityDefined/__tests__/index.ts
+++ b/src/rulesets/oas/functions/oasOpSecurityDefined/__tests__/index.ts
@@ -1,8 +1,8 @@
 import { RuleType, Spectral } from '../../../../../index';
 import { oas2Functions } from '../../../../oas2/index';
-import { rules as oas2Rules } from '../../../../oas2/rules.json';
+import { rules as oas2Rules } from '../../../../oas2/index.json';
 import { oas3Functions } from '../../../../oas3/index';
-import { rules as oas3Rules } from '../../../../oas3/rules.json';
+import { rules as oas3Rules } from '../../../../oas3/index.json';
 
 const oas2Ruleset = { functions: oas2Functions(), rules: oas2Rules };
 const oas3Ruleset = { functions: oas3Functions(), rules: oas3Rules };
diff --git a/src/rulesets/oas/functions/oasPathParam/__tests__/index.test.ts b/src/rulesets/oas/functions/oasPathParam/__tests__/index.test.ts
index d0b4cd4a..b645730a 100644
--- a/src/rulesets/oas/functions/oasPathParam/__tests__/index.test.ts
+++ b/src/rulesets/oas/functions/oasPathParam/__tests__/index.test.ts
@@ -1,7 +1,7 @@
 import { RuleType, Spectral } from '../../../../../index';
 import { commonOasFunctions } from '../../../index';
 
-import { rules } from '../../../rules.json';
+import { rules } from '../../../index.json';
 
 const ruleset = { functions: commonOasFunctions(), rules };
 
diff --git a/src/rulesets/oas2/__tests__/api-host.ts b/src/rulesets/oas2/__tests__/api-host.ts
index 667f49ca..5044b46f 100644
--- a/src/rulesets/oas2/__tests__/api-host.ts
+++ b/src/rulesets/oas2/__tests__/api-host.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('api-host', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas2/__tests__/api-schemes.ts b/src/rulesets/oas2/__tests__/api-schemes.ts
index 0c4f92c2..ce0e226a 100644
--- a/src/rulesets/oas2/__tests__/api-schemes.ts
+++ b/src/rulesets/oas2/__tests__/api-schemes.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('api-schemes', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas2/__tests__/host-not-example.ts b/src/rulesets/oas2/__tests__/host-not-example.ts
index 05b76277..ac11426b 100644
--- a/src/rulesets/oas2/__tests__/host-not-example.ts
+++ b/src/rulesets/oas2/__tests__/host-not-example.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('host-not-example', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas2/__tests__/host-trailing-slash.ts b/src/rulesets/oas2/__tests__/host-trailing-slash.ts
index 0e140a20..b878c28a 100644
--- a/src/rulesets/oas2/__tests__/host-trailing-slash.ts
+++ b/src/rulesets/oas2/__tests__/host-trailing-slash.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('host-trailing-slash', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas2/__tests__/model-description.ts b/src/rulesets/oas2/__tests__/model-description.ts
index 0f520ebc..507f4c64 100644
--- a/src/rulesets/oas2/__tests__/model-description.ts
+++ b/src/rulesets/oas2/__tests__/model-description.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('model-description', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas2/__tests__/oas2-schema.ts b/src/rulesets/oas2/__tests__/oas2-schema.ts
index 2bb773fd..078579b9 100644
--- a/src/rulesets/oas2/__tests__/oas2-schema.ts
+++ b/src/rulesets/oas2/__tests__/oas2-schema.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('oas2-schema', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas2/__tests__/valid-example.ts b/src/rulesets/oas2/__tests__/valid-example.ts
index 7c8ae646..e7f46164 100644
--- a/src/rulesets/oas2/__tests__/valid-example.ts
+++ b/src/rulesets/oas2/__tests__/valid-example.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('valid-example', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas3/__tests__/api-servers.ts b/src/rulesets/oas3/__tests__/api-servers.ts
index e74dfa36..ab95327d 100644
--- a/src/rulesets/oas3/__tests__/api-servers.ts
+++ b/src/rulesets/oas3/__tests__/api-servers.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('api-servers', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas3/__tests__/model-description.ts b/src/rulesets/oas3/__tests__/model-description.ts
index 9fa6d29f..e833fd5b 100644
--- a/src/rulesets/oas3/__tests__/model-description.ts
+++ b/src/rulesets/oas3/__tests__/model-description.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('model-description', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas3/__tests__/server-not-example.ts b/src/rulesets/oas3/__tests__/server-not-example.ts
index d9b926ca..3f609d01 100644
--- a/src/rulesets/oas3/__tests__/server-not-example.ts
+++ b/src/rulesets/oas3/__tests__/server-not-example.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('server-not-example.com', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas3/__tests__/server-trailing-slash.ts b/src/rulesets/oas3/__tests__/server-trailing-slash.ts
index 9beebbbc..75e183c8 100644
--- a/src/rulesets/oas3/__tests__/server-trailing-slash.ts
+++ b/src/rulesets/oas3/__tests__/server-trailing-slash.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 describe('server-trailing-slash', () => {
   const s = new Spectral();
diff --git a/src/rulesets/oas3/__tests__/valid-example.ts b/src/rulesets/oas3/__tests__/valid-example.ts
index c9133bbd..c4b99d4e 100644
--- a/src/rulesets/oas3/__tests__/valid-example.ts
+++ b/src/rulesets/oas3/__tests__/valid-example.ts
@@ -1,5 +1,5 @@
 import { RuleType, Spectral } from '../../../spectral';
-import * as ruleset from '../rules.json';
+import * as ruleset from '../index.json';
 
 // @oclif/test packages requires @types/mocha, therefore we have 2 packages coming up with similar typings
 // TS is confused and prefers the mocha ones, so we need to instrument it to pick up the Jest ones