@fullstacksjs/eslint-config 12.1.0 → 12.1.1

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/cjs/index.js CHANGED
@@ -97,17 +97,17 @@ function defineConfig(initOptions = {}, ...extend) {
97
97
  if (enableSort) rules.push((0, _perfectionist.default)(options));
98
98
  if (enableImport) rules.push((0, _imports.default)(options));
99
99
  if (enableTailwind) rules.push((0, _tailwind.default)(options));
100
- if (enableTest) rules.push((0, _tests.default)(options));
101
100
  if (enableNode) rules.push((0, _node.default)(options));
102
- if (enableJest) rules.push((0, _jest.default)(options));
103
- if (enableVitest) rules.push((0, _vitest.default)(options));
104
- if (enableCypress) rules.push((0, _cypress.default)(options));
105
101
  if (enableReact) rules.push((0, _react.default)(options));
106
102
  if (enableStorybook) rules.push((0, _storybook.default)(options));
107
103
  if (enableTypescript) rules.push((0, _typescript.default)(options));
108
- if (enablePlaywright) rules.push((0, _playwright.default)(options));
109
- if (enableNext && enableNext) rules.push((0, _next.default)(options));
104
+ if (enableNext) rules.push((0, _next.default)(options));
110
105
  if (enablePrettier) rules.push((0, _prettier.default)(options));
106
+ if (enableJest) rules.push((0, _jest.default)(options));
107
+ if (enableVitest) rules.push((0, _vitest.default)(options));
108
+ if (enableTest) rules.push((0, _tests.default)(options));
109
+ if (enableCypress) rules.push((0, _cypress.default)(options));
110
+ if (enablePlaywright) rules.push((0, _playwright.default)(options));
111
111
  if (Object.keys(eslintOptions).length > 0) rules.push(eslintOptions);
112
112
  if (extend) Array.prototype.push.apply(rules, extend);
113
113
  return (0, _config.defineConfig)(rules);
@@ -13,6 +13,7 @@ var _namingConvention = require("../utils/naming-convention.js");
13
13
  * @return { import('eslint').Linter.Config }
14
14
  */
15
15
  function typescript(options = {}) {
16
+ const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
16
17
  return {
17
18
  files: [_globs.globs.ts, _globs.globs.tsx],
18
19
  plugins: {
@@ -55,7 +56,7 @@ function typescript(options = {}) {
55
56
  '@typescript-eslint/member-naming': 'off',
56
57
  '@typescript-eslint/member-ordering': 'off',
57
58
  '@typescript-eslint/method-signature-style': ['warn', 'property'],
58
- '@typescript-eslint/naming-convention': ['warn', ..._namingConvention.namingConvention, ...(options.typescript && options.typescript.projects ? [{
59
+ '@typescript-eslint/naming-convention': ['warn', ..._namingConvention.namingConvention, ...(projectService ? [{
59
60
  selector: 'variable',
60
61
  types: ['boolean'],
61
62
  format: ['PascalCase'],
@@ -160,7 +161,7 @@ function typescript(options = {}) {
160
161
  }],
161
162
  '@typescript-eslint/unified-signatures': 'error',
162
163
  '@typescript-eslint/key-spacing': 'off',
163
- ...(0, _conditions.predicate)(options.typescript && options.typescript.projects, {
164
+ ...(0, _conditions.predicate)(projectService, {
164
165
  '@typescript-eslint/await-thenable': 'error',
165
166
  '@typescript-eslint/consistent-return': 'off',
166
167
  '@typescript-eslint/consistent-type-exports': 'warn',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "12.1.0",
3
+ "version": "12.1.1",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
package/src/index.mjs CHANGED
@@ -92,17 +92,17 @@ export function defineConfig(initOptions = {}, ...extend) {
92
92
  if (enableSort) rules.push(perfectionist(options));
93
93
  if (enableImport) rules.push(imports(options));
94
94
  if (enableTailwind) rules.push(tailwind(options));
95
- if (enableTest) rules.push(tests(options));
96
95
  if (enableNode) rules.push(node(options));
97
- if (enableJest) rules.push(jest(options));
98
- if (enableVitest) rules.push(vitest(options));
99
- if (enableCypress) rules.push(cypress(options));
100
96
  if (enableReact) rules.push(react(options));
101
97
  if (enableStorybook) rules.push(storybook(options));
102
98
  if (enableTypescript) rules.push(typescript(options));
103
- if (enablePlaywright) rules.push(playwright(options));
104
- if (enableNext && enableNext) rules.push(next(options));
99
+ if (enableNext) rules.push(next(options));
105
100
  if (enablePrettier) rules.push(prettier(options));
101
+ if (enableJest) rules.push(jest(options));
102
+ if (enableVitest) rules.push(vitest(options));
103
+ if (enableTest) rules.push(tests(options));
104
+ if (enableCypress) rules.push(cypress(options));
105
+ if (enablePlaywright) rules.push(playwright(options));
106
106
 
107
107
  if (Object.keys(eslintOptions).length > 0) rules.push(eslintOptions);
108
108
  if (extend) Array.prototype.push.apply(rules, extend);
@@ -9,6 +9,8 @@ import { namingConvention } from '../utils/naming-convention.mjs';
9
9
  * @return { import('eslint').Linter.Config }
10
10
  */
11
11
  function typescript(options = {}) {
12
+ const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
13
+
12
14
  return {
13
15
  files: [globs.ts, globs.tsx],
14
16
  plugins: { '@typescript-eslint': plugin },
@@ -54,7 +56,7 @@ function typescript(options = {}) {
54
56
  '@typescript-eslint/naming-convention': [
55
57
  'warn',
56
58
  ...namingConvention,
57
- ...(options.typescript && options.typescript.projects
59
+ ...(projectService
58
60
  ? [
59
61
  {
60
62
  selector: 'variable',
@@ -142,7 +144,7 @@ function typescript(options = {}) {
142
144
  '@typescript-eslint/unified-signatures': 'error',
143
145
  '@typescript-eslint/key-spacing': 'off',
144
146
 
145
- ...predicate(options.typescript && options.typescript.projects, {
147
+ ...predicate(projectService, {
146
148
  '@typescript-eslint/await-thenable': 'error',
147
149
  '@typescript-eslint/consistent-return': 'off',
148
150
  '@typescript-eslint/consistent-type-exports': 'warn',