@vijayhardaha/dev-config 1.0.12 → 1.1.0

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.
Files changed (36) hide show
  1. package/README.md +97 -13
  2. package/package.json +53 -93
  3. package/src/commitlint/index.js +3 -3
  4. package/src/commitlint/index.test.js +49 -0
  5. package/src/eslint/index.js +17 -53
  6. package/src/eslint/index.test.js +22 -0
  7. package/src/eslint/lib/build-config.js +85 -0
  8. package/src/eslint/lib/build-config.test.js +30 -0
  9. package/src/eslint/lib/files.js +6 -0
  10. package/src/eslint/lib/files.test.js +31 -0
  11. package/src/eslint/lib/ignores.js +184 -0
  12. package/src/eslint/lib/ignores.test.js +37 -0
  13. package/src/eslint/lib/index.js +3 -0
  14. package/src/eslint/lib/index.test.js +37 -0
  15. package/src/eslint/lib/language-options.js +13 -0
  16. package/src/eslint/lib/language-options.test.js +28 -0
  17. package/src/eslint/{common.js → lib/rules.js} +4 -103
  18. package/src/eslint/lib/rules.test.js +73 -0
  19. package/src/eslint/lib/setup.js +29 -0
  20. package/src/eslint/lib/setup.test.js +25 -0
  21. package/src/eslint/next.js +30 -59
  22. package/src/eslint/next.test.js +32 -0
  23. package/src/eslint/react.js +27 -55
  24. package/src/eslint/react.test.js +22 -0
  25. package/src/eslint/typescript.js +19 -43
  26. package/src/eslint/typescript.test.js +22 -0
  27. package/src/index.js +3 -3
  28. package/src/index.test.js +36 -0
  29. package/src/jsconfig/index.test.js +34 -0
  30. package/src/next-sitemap/index.js +3 -3
  31. package/src/next-sitemap/index.test.js +59 -0
  32. package/src/prettier/index.js +3 -3
  33. package/src/prettier/index.test.js +39 -0
  34. package/src/stylelint/index.js +3 -3
  35. package/src/stylelint/index.test.js +52 -0
  36. package/src/tsconfig/index.test.js +52 -0
@@ -0,0 +1,52 @@
1
+ import { describe, it, expect } from 'vitest';
2
+
3
+ // Test suite for the Stylelint configuration module.
4
+ describe('stylelint/index.js', () => {
5
+ // Test that the module exports a default configuration object.
6
+ it('should export default config object', async () => {
7
+ // Dynamically import the index.js module to test its exports.
8
+ const module = await import('./index.js');
9
+
10
+ // Verify that the default export is an object (Stylelint config).
11
+ expect(typeof module.default).toBe('object');
12
+ });
13
+
14
+ // Test that the config has an extends array (inherits from base configs).
15
+ it('should have extends property', async () => {
16
+ // Dynamically import the index.js module to test its exports.
17
+ const module = await import('./index.js');
18
+
19
+ // Verify that extends is an array (list of config files to extend).
20
+ expect(Array.isArray(module.default.extends)).toBe(true);
21
+ });
22
+
23
+ // Test that the config has a plugins array (contains Stylelint plugins).
24
+ it('should have plugins property', async () => {
25
+ // Dynamically import the index.js module to test its exports.
26
+ const module = await import('./index.js');
27
+
28
+ // Verify that plugins is an array (list of Stylelint plugins).
29
+ expect(Array.isArray(module.default.plugins)).toBe(true);
30
+ });
31
+
32
+ // Test that the config has a rules object (contains Stylelint rules).
33
+ it('should have rules property', async () => {
34
+ // Dynamically import the index.js module to test its exports.
35
+ const module = await import('./index.js');
36
+
37
+ // Verify that rules is an object (key-value pairs of rule configurations).
38
+ expect(typeof module.default.rules).toBe('object');
39
+ });
40
+
41
+ // Test that specific rules are disabled (set to null).
42
+ it('should have disabled rules', async () => {
43
+ // Dynamically import the index.js module to test its exports.
44
+ const module = await import('./index.js');
45
+
46
+ // Verify that selector-class-pattern rule is disabled (null).
47
+ expect(module.default.rules['selector-class-pattern']).toBeNull();
48
+
49
+ // Verify that selector-id-pattern rule is disabled (null).
50
+ expect(module.default.rules['selector-id-pattern']).toBeNull();
51
+ });
52
+ });
@@ -0,0 +1,52 @@
1
+ import { describe, it, expect } from 'vitest';
2
+
3
+ // Test suite for the TypeScript base configuration file.
4
+ describe('tsconfig/index.json', () => {
5
+ // Test that the tsconfig file is valid JSON and exports an object.
6
+ it('should be a valid JSON file', async () => {
7
+ // Dynamically import the JSON file with JSON assertion.
8
+ const module = await import('./index.json', { assert: { type: 'json' } });
9
+
10
+ // Verify that the default export is an object (valid JSON object).
11
+ expect(typeof module.default).toBe('object');
12
+ });
13
+
14
+ // Test that the tsconfig contains compilerOptions.
15
+ it('should have compilerOptions', async () => {
16
+ // Dynamically import the JSON file with JSON assertion.
17
+ const module = await import('./index.json', { assert: { type: 'json' } });
18
+
19
+ // Verify that compilerOptions property exists on the config object.
20
+ expect(module.default.compilerOptions).toBeDefined();
21
+
22
+ // Verify that compilerOptions is an object.
23
+ expect(typeof module.default.compilerOptions).toBe('object');
24
+ });
25
+
26
+ // Test that the tsconfig has the correct ECMAScript target.
27
+ it('should have correct target', async () => {
28
+ // Dynamically import the JSON file with JSON assertion.
29
+ const module = await import('./index.json', { assert: { type: 'json' } });
30
+
31
+ // Verify that the target is set to ES2024 (modern JavaScript).
32
+ expect(module.default.compilerOptions.target).toBe('ES2024');
33
+ });
34
+
35
+ // Test that the tsconfig has JSX configured for React.
36
+ it('should have jsx configured', async () => {
37
+ // Dynamically import the JSON file with JSON assertion.
38
+ const module = await import('./index.json', { assert: { type: 'json' } });
39
+
40
+ // Verify that JSX is configured to use react-jsx preset.
41
+ expect(module.default.compilerOptions.jsx).toBe('react-jsx');
42
+ });
43
+
44
+ // Test that the tsconfig has strict mode enabled.
45
+ it('should have strict mode enabled', async () => {
46
+ // Dynamically import the JSON file with JSON assertion.
47
+ const module = await import('./index.json', { assert: { type: 'json' } });
48
+
49
+ // Verify that strict type checking options are enabled.
50
+ expect(module.default.compilerOptions.strict).toBe(true);
51
+ });
52
+ });