@msobiecki/eslint-config 8.9.13 → 8.11.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.
package/.eslintrc.json CHANGED
@@ -1,6 +1,3 @@
1
1
  {
2
- "extends": [
3
- "./index.js",
4
- "./best-practice.js"
5
- ]
2
+ "extends": ["./index.js", "./best-practice.js"]
6
3
  }
@@ -2,7 +2,7 @@ name: Release publish
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [ master ]
5
+ branches: [master]
6
6
 
7
7
  jobs:
8
8
  publish:
package/CHANGELOG.md CHANGED
@@ -1,20 +1,30 @@
1
- ## [8.9.13](https://github.com/msobiecki/eslint-config/compare/v8.9.12...v8.9.13) (2025-03-23)
1
+ # [8.11.0](https://github.com/msobiecki/eslint-config/compare/v8.10.0...v8.11.0) (2025-04-17)
2
2
 
3
3
 
4
+ ### Features
4
5
 
5
- ## [8.9.12](https://github.com/msobiecki/eslint-config/compare/v8.9.11...v8.9.12) (2025-03-23)
6
+ * update ([d3088d2](https://github.com/msobiecki/eslint-config/commit/d3088d2a844617dc92ab5f3b40e4a1b77b11079f))
6
7
 
7
8
 
8
9
 
9
- ## [8.9.11](https://github.com/msobiecki/eslint-config/compare/v8.9.10...v8.9.11) (2025-01-28)
10
+ # [8.10.0](https://github.com/msobiecki/eslint-config/compare/v8.9.13...v8.10.0) (2025-04-17)
11
+
12
+
13
+ ### Features
14
+
15
+ * update ([2c5d766](https://github.com/msobiecki/eslint-config/commit/2c5d76693afb60b832c5c7960934fa59c5214a75))
10
16
 
11
17
 
12
18
 
13
- ## [8.9.10](https://github.com/msobiecki/eslint-config/compare/v8.9.9...v8.9.10) (2024-12-04)
19
+ ## [8.9.13](https://github.com/msobiecki/eslint-config/compare/v8.9.12...v8.9.13) (2025-03-23)
20
+
21
+
22
+
23
+ ## [8.9.12](https://github.com/msobiecki/eslint-config/compare/v8.9.11...v8.9.12) (2025-03-23)
14
24
 
15
25
 
16
26
 
17
- ## [8.9.9](https://github.com/msobiecki/eslint-config/compare/v8.9.8...v8.9.9) (2024-12-04)
27
+ ## [8.9.11](https://github.com/msobiecki/eslint-config/compare/v8.9.10...v8.9.11) (2025-01-28)
18
28
 
19
29
 
20
30
 
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": ["../jest.js"]
3
+ }
@@ -0,0 +1,38 @@
1
+ import path from "node:path";
2
+ import process from "node:process";
3
+
4
+ import { ESLint } from "eslint";
5
+
6
+ const testCases = [
7
+ {
8
+ file: "__tests__/cases/base/no-console.js",
9
+ expectedRules: ["no-console"],
10
+ },
11
+ ];
12
+
13
+ describe("check ESLint test cases", () => {
14
+ let eslint;
15
+
16
+ beforeEach(() => {
17
+ eslint = new ESLint({
18
+ useEslintrc: false,
19
+ overrideConfigFile: path.resolve(process.cwd(), "presets/base/base.js"),
20
+ });
21
+ });
22
+
23
+ // eslint-disable-next-line no-restricted-syntax
24
+ for (const { file, expectedRules } of testCases) {
25
+ // eslint-disable-next-line no-loop-func
26
+ test(`${file} should trigger expected ESLint rules`, async () => {
27
+ const results = await eslint.lintFiles([file]);
28
+ const messages = results[0]?.messages || [];
29
+
30
+ const triggeredRules = messages.map((m) => m.ruleId).filter(Boolean);
31
+
32
+ // eslint-disable-next-line no-restricted-syntax
33
+ for (const expectedRule of expectedRules) {
34
+ expect(triggeredRules).toContain(expectedRule);
35
+ }
36
+ });
37
+ }
38
+ });
@@ -0,0 +1,6 @@
1
+ // ❌ Violates: no-console (Airbnb)
2
+ export const sayHi = () => {
3
+ console.log("Hi");
4
+ };
5
+
6
+ export default sayHi;
package/jest.config.js ADDED
@@ -0,0 +1,196 @@
1
+ /**
2
+ * For a detailed explanation regarding each configuration property, visit:
3
+ * https://jestjs.io/docs/configuration
4
+ */
5
+
6
+ /** @type {import('jest').Config} */
7
+ const config = {
8
+ // All imported modules in your tests should be mocked automatically
9
+ // automock: false,
10
+
11
+ // Stop running tests after `n` failures
12
+ // bail: 0,
13
+
14
+ // The directory where Jest should store its cached dependency information
15
+ // cacheDirectory: "/private/var/folders/16/wlp196h16vjfc5kffj1l3hv80000gn/T/jest_dx",
16
+
17
+ // Automatically clear mock calls, instances, contexts and results before every test
18
+ clearMocks: true,
19
+
20
+ // Indicates whether the coverage information should be collected while executing the test
21
+ // collectCoverage: false,
22
+
23
+ // An array of glob patterns indicating a set of files for which coverage information should be collected
24
+ // collectCoverageFrom: undefined,
25
+
26
+ // The directory where Jest should output its coverage files
27
+ // coverageDirectory: undefined,
28
+
29
+ // An array of regexp pattern strings used to skip coverage collection
30
+ // coveragePathIgnorePatterns: [
31
+ // "/node_modules/"
32
+ // ],
33
+
34
+ // Indicates which provider should be used to instrument code for coverage
35
+ coverageProvider: "v8",
36
+
37
+ // A list of reporter names that Jest uses when writing coverage reports
38
+ // coverageReporters: [
39
+ // "json",
40
+ // "text",
41
+ // "lcov",
42
+ // "clover"
43
+ // ],
44
+
45
+ // An object that configures minimum threshold enforcement for coverage results
46
+ // coverageThreshold: undefined,
47
+
48
+ // A path to a custom dependency extractor
49
+ // dependencyExtractor: undefined,
50
+
51
+ // Make calling deprecated APIs throw helpful error messages
52
+ // errorOnDeprecated: false,
53
+
54
+ // The default configuration for fake timers
55
+ // fakeTimers: {
56
+ // "enableGlobally": false
57
+ // },
58
+
59
+ // Force coverage collection from ignored files using an array of glob patterns
60
+ // forceCoverageMatch: [],
61
+
62
+ // A path to a module which exports an async function that is triggered once before all test suites
63
+ // globalSetup: undefined,
64
+
65
+ // A path to a module which exports an async function that is triggered once after all test suites
66
+ // globalTeardown: undefined,
67
+
68
+ // A set of global variables that need to be available in all test environments
69
+ // globals: {},
70
+
71
+ // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
72
+ // maxWorkers: "50%",
73
+
74
+ // An array of directory names to be searched recursively up from the requiring module's location
75
+ // moduleDirectories: [
76
+ // "node_modules"
77
+ // ],
78
+
79
+ // An array of file extensions your modules use
80
+ // moduleFileExtensions: [
81
+ // "js",
82
+ // "mjs",
83
+ // "cjs",
84
+ // "jsx",
85
+ // "ts",
86
+ // "tsx",
87
+ // "json",
88
+ // "node"
89
+ // ],
90
+
91
+ // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
92
+ // moduleNameMapper: {},
93
+
94
+ // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
95
+ // modulePathIgnorePatterns: [],
96
+
97
+ // Activates notifications for test results
98
+ // notify: false,
99
+
100
+ // An enum that specifies notification mode. Requires { notify: true }
101
+ // notifyMode: "failure-change",
102
+
103
+ // A preset that is used as a base for Jest's configuration
104
+ // preset: undefined,
105
+
106
+ // Run tests from one or more projects
107
+ // projects: undefined,
108
+
109
+ // Use this configuration option to add custom reporters to Jest
110
+ // reporters: undefined,
111
+
112
+ // Automatically reset mock state before every test
113
+ // resetMocks: false,
114
+
115
+ // Reset the module registry before running each individual test
116
+ // resetModules: false,
117
+
118
+ // A path to a custom resolver
119
+ // resolver: undefined,
120
+
121
+ // Automatically restore mock state and implementation before every test
122
+ // restoreMocks: false,
123
+
124
+ // The root directory that Jest should scan for tests and modules within
125
+ // rootDir: undefined,
126
+
127
+ // A list of paths to directories that Jest should use to search for files in
128
+ // roots: [
129
+ // "<rootDir>"
130
+ // ],
131
+
132
+ // Allows you to use a custom runner instead of Jest's default test runner
133
+ // runner: "jest-runner",
134
+
135
+ // The paths to modules that run some code to configure or set up the testing environment before each test
136
+ // setupFiles: [],
137
+
138
+ // A list of paths to modules that run some code to configure or set up the testing framework before each test
139
+ // setupFilesAfterEnv: [],
140
+
141
+ // The number of seconds after which a test is considered as slow and reported as such in the results.
142
+ // slowTestThreshold: 5,
143
+
144
+ // A list of paths to snapshot serializer modules Jest should use for snapshot testing
145
+ // snapshotSerializers: [],
146
+
147
+ // The test environment that will be used for testing
148
+ // testEnvironment: "jest-environment-node",
149
+
150
+ // Options that will be passed to the testEnvironment
151
+ // testEnvironmentOptions: {},
152
+
153
+ // Adds a location field to test results
154
+ // testLocationInResults: false,
155
+
156
+ // The glob patterns Jest uses to detect test files
157
+ // testMatch: [
158
+ // "**/__tests__/**/*.[jt]s?(x)",
159
+ // "**/?(*.)+(spec|test).[tj]s?(x)"
160
+ // ],
161
+
162
+ // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
163
+ testPathIgnorePatterns: ["/__tests__/cases/"],
164
+
165
+ // The regexp pattern or array of patterns that Jest uses to detect test files
166
+ // testRegex: [],
167
+
168
+ // This option allows the use of a custom results processor
169
+ // testResultsProcessor: undefined,
170
+
171
+ // This option allows use of a custom test runner
172
+ // testRunner: "jest-circus/runner",
173
+
174
+ // A map from regular expressions to paths to transformers
175
+ transform: { "^.+\\.js$": "@swc/jest" },
176
+
177
+ // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
178
+ // transformIgnorePatterns: [
179
+ // "/node_modules/",
180
+ // "\\.pnp\\.[^\\/]+$"
181
+ // ],
182
+
183
+ // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
184
+ // unmockedModulePathPatterns: undefined,
185
+
186
+ // Indicates whether each individual test should be reported during the run
187
+ // verbose: undefined,
188
+
189
+ // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
190
+ // watchPathIgnorePatterns: [],
191
+
192
+ // Whether to use watchman for file crawling
193
+ // watchman: true,
194
+ };
195
+
196
+ module.exports = config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@msobiecki/eslint-config",
3
- "version": "8.9.13",
3
+ "version": "8.11.0",
4
4
  "private": false,
5
5
  "description": "An ESLint shareable config for JavaScript/TypeScript ecosystem's.",
6
6
  "keywords": [
@@ -18,7 +18,9 @@
18
18
  "author": "Michał Sobiecki <kontakt@codeshaker.pl>",
19
19
  "main": "index.js",
20
20
  "scripts": {
21
- "prepare": "husky install"
21
+ "prepare": "husky install",
22
+ "test": "jest",
23
+ "test:watch": "jest --watch"
22
24
  },
23
25
  "dependencies": {
24
26
  "eslint-config-airbnb": "^19.0.4",
@@ -46,8 +48,12 @@
46
48
  "devDependencies": {
47
49
  "@commitlint/cli": "^19.5.0",
48
50
  "@commitlint/config-conventional": "^19.5.0",
51
+ "@swc/core": "^1.11.21",
52
+ "@swc/jest": "^0.2.37",
53
+ "@types/jest": "^29.5.14",
49
54
  "eslint": "^8.57.1",
50
55
  "husky": "^9.1.6",
56
+ "jest": "^29.7.0",
51
57
  "lint-staged": "^15.2.10",
52
58
  "prettier": "^3.3.3"
53
59
  },