@fullstacksjs/eslint-config 9.0.8 → 9.0.10

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/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  require('./registerOpts');
2
2
  const { compact } = require('@fullstacksjs/toolbox');
3
- const init = require('./init');
4
3
 
5
4
  /** @type { import('eslint').Linter.Config } */
6
5
  module.exports = {
@@ -18,5 +17,3 @@ module.exports = {
18
17
  require.resolve('./prettier'),
19
18
  ]),
20
19
  };
21
-
22
- module.exports.init = init;
package/init.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ export interface Options {
2
+ react: 'next' | 'raw';
3
+ typescript: { parserProject: string[] | string; resolverProject: string[] | string };
4
+ node: boolean;
5
+ strict: boolean;
6
+ import: boolean;
7
+ esm: boolean;
8
+ graphql: boolean;
9
+ test: boolean;
10
+ cypress: boolean;
11
+ storybook: boolean;
12
+ overrides: import('eslint').Linter.Config;
13
+ }
14
+
15
+ export declare const init: (opts: Options) => import('eslint').Linter.Config
package/init.js CHANGED
@@ -1,9 +1,9 @@
1
+ require('./registerOpts');
1
2
  const { compact } = require('@fullstacksjs/toolbox');
3
+ const merge = require('deepmerge');
2
4
 
3
- /** @param { import('./index.d').Options } opts */
5
+ /** @param { import('./init.d').Options } opts */
4
6
  function init(opts = {}) {
5
- const merge = require('deepmerge');
6
-
7
7
  const { extends: extendsOverrides, ...overrides } = opts.overrides;
8
8
  global.fullstacksjs = merge(global.fullstacksjs, opts);
9
9
 
@@ -30,14 +30,14 @@ function init(opts = {}) {
30
30
 
31
31
  if (opts.react === 'raw') config.extends.push(require.resolve('./react.js'));
32
32
 
33
- if (opts.typescript.parserProject) {
33
+ if (opts.typescript?.parserProject) {
34
34
  config.parserOptions = {
35
35
  ...config.parserOptions,
36
36
  project: opts.typescript.parserProject,
37
37
  };
38
38
  }
39
39
 
40
- if (opts.typescript.resolverProject) {
40
+ if (opts.typescript?.resolverProject) {
41
41
  config.extends.push(require.resolve('./typecheck.js'));
42
42
  config.settings = {
43
43
  ...config.settings,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "9.0.8",
3
+ "version": "9.0.10",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
@@ -11,7 +11,6 @@
11
11
  "publishConfig": {
12
12
  "registry": "https://registry.npmjs.org"
13
13
  },
14
- "typings": "./index.d.ts",
15
14
  "files": [
16
15
  "base.js",
17
16
  "cypress.js",
@@ -19,9 +18,9 @@
19
18
  "fp.js",
20
19
  "graphql.js",
21
20
  "import.js",
22
- "index.js",
23
- "index.d.js",
21
+ "index.d.ts",
24
22
  "init.js",
23
+ "init.d.ts",
25
24
  "jest.js",
26
25
  "naming-convention.js",
27
26
  "node.js",
package/registerOpts.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const { hasDep, isEsm } = require('./utils');
2
2
 
3
- /** @param { import('./index.d').Options } opts */
3
+ /** @param { import('./init').Options } opts */
4
4
  const defaultOptions = {
5
5
  esm: isEsm(),
6
6
  cypress: hasDep('cypress'),