@microsoft/eslint-config-spfx 1.22.1 → 1.23.0-beta.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.
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const webAppProfile = require('@rushstack/eslint-config/flat/profile/web-app');
6
+ const spfxPlugin = require('@microsoft/eslint-plugin-spfx');
7
+ const config = [
8
+ ...webAppProfile,
9
+ // Ignore generated SCSS type stubs and declaration files
10
+ {
11
+ ignores: [
12
+ '**/*.scss.ts',
13
+ '**/*.d.ts'
14
+ ]
15
+ },
16
+ // SPFx rules scoped to TypeScript files
17
+ {
18
+ files: [
19
+ '**/*.ts',
20
+ '**/*.tsx'
21
+ ],
22
+ plugins: {
23
+ '@microsoft/spfx': spfxPlugin
24
+ },
25
+ rules: {
26
+ // ---------------------------------------------------------------
27
+ // OVERRIDE rules: same rule as upstream @rushstack/eslint-config,
28
+ // but with SPFx-specific severity or options.
29
+ // ---------------------------------------------------------------
30
+ '@rushstack/hoist-jest-mock': 'warn',
31
+ '@typescript-eslint/explicit-member-accessibility': 'off',
32
+ '@typescript-eslint/no-floating-promises': 'error',
33
+ '@typescript-eslint/parameter-properties': 'off',
34
+ '@typescript-eslint/no-unused-vars': [
35
+ 'warn',
36
+ {
37
+ vars: 'all',
38
+ args: 'none'
39
+ }
40
+ ],
41
+ 'accessor-pairs': 'warn',
42
+ eqeqeq: 'warn',
43
+ 'no-extend-native': 'warn',
44
+ 'no-extra-boolean-cast': 'off',
45
+ 'no-sequences': 'warn',
46
+ 'no-void': 'warn',
47
+ // ---------------------------------------------------------------
48
+ // SPFx-ONLY rules: not present in upstream @rushstack/eslint-config.
49
+ // ---------------------------------------------------------------
50
+ '@rushstack/import-requires-chunk-name': 'warn',
51
+ '@rushstack/pair-react-dom-render-unmount': 'warn',
52
+ '@typescript-eslint/no-var-requires': 'error',
53
+ '@typescript-eslint/no-inferrable-types': 'off',
54
+ '@typescript-eslint/no-empty-interface': 'off',
55
+ '@microsoft/spfx/no-require-ensure': 'error',
56
+ // -------------------------------------------------------------------
57
+ // Upstream rules from @rushstack/eslint-config that are NOT currently
58
+ // enabled in SPFx generated projects (absent from both Heft and Gulp
59
+ // templates). Explicitly disabled to maintain behavioral parity.
60
+ // Reviewers: consider whether any of these should be enabled for SPFx.
61
+ // -------------------------------------------------------------------
62
+ // Requires local variables to have type annotations when the initializer
63
+ // is not a basic type (string, number, boolean).
64
+ '@rushstack/typedef-var': 'off',
65
+ // Requires type annotations on function parameters, member variables,
66
+ // and other declarations. Can be verbose for SPFx component code.
67
+ '@typescript-eslint/typedef': 'off',
68
+ // Enforces naming conventions (camelCase, PascalCase, etc.) on
69
+ // variables, functions, types, and other identifiers.
70
+ '@typescript-eslint/naming-convention': 'off',
71
+ // Enforces a consistent ordering of class members
72
+ // (fields, constructors, methods).
73
+ '@typescript-eslint/member-ordering': 'off',
74
+ // Enforces consistent use of type assertions (`as` vs angle-bracket).
75
+ '@typescript-eslint/consistent-type-assertions': 'off',
76
+ // Enforces consistent use of `interface` vs `type` for object type definitions.
77
+ '@typescript-eslint/consistent-type-definitions': 'off',
78
+ // Disallows the `Function` type in favor of more specific function signatures.
79
+ '@typescript-eslint/no-unsafe-function-type': 'off',
80
+ // Disallows `String`, `Number`, `Boolean` wrapper object types in favor
81
+ // of their lowercase primitives.
82
+ '@typescript-eslint/no-wrapper-object-types': 'off',
83
+ // Disallows bitwise operators (|, &, ^, ~, <<, >>). Catches accidental
84
+ // use of | instead of || and & instead of &&.
85
+ 'no-bitwise': 'off'
86
+ }
87
+ },
88
+ // Match the current legacy profile: disable these rules for TypeScript files
89
+ {
90
+ files: [
91
+ '**/*.ts',
92
+ '**/*.tsx'
93
+ ],
94
+ rules: {
95
+ '@typescript-eslint/no-require-imports': 'off',
96
+ '@typescript-eslint/no-empty-object-type': 'off'
97
+ }
98
+ }
99
+ ];
100
+ module.exports = config;
101
+
102
+ //# sourceMappingURL=./default.js.map
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const reactHooksPlugin = require('eslint-plugin-react-hooks');
6
+ const reactMixin = require('@rushstack/eslint-config/flat/mixins/react');
7
+ const defaultProfile = require('./default');
8
+ const config = [
9
+ ...defaultProfile,
10
+ ...reactMixin,
11
+ {
12
+ files: [
13
+ '**/*.ts',
14
+ '**/*.tsx'
15
+ ],
16
+ plugins: {
17
+ 'react-hooks': reactHooksPlugin
18
+ }
19
+ },
20
+ // SPFx override: allow inline arrow functions in JSX props
21
+ {
22
+ files: [
23
+ '**/*.tsx'
24
+ ],
25
+ rules: {
26
+ 'react/jsx-no-bind': 'off'
27
+ }
28
+ }
29
+ ];
30
+ module.exports = config;
31
+
32
+ //# sourceMappingURL=./react.js.map
@@ -12,12 +12,20 @@ _export(exports, {
12
12
  Default: function() {
13
13
  return _default;
14
14
  },
15
+ FlatDefault: function() {
16
+ return _default1;
17
+ },
18
+ FlatReact: function() {
19
+ return _react1;
20
+ },
15
21
  React: function() {
16
22
  return _react;
17
23
  }
18
24
  });
19
25
  const _default = /*#__PURE__*/ _interop_require_wildcard(require("./profiles/default"));
20
26
  const _react = /*#__PURE__*/ _interop_require_wildcard(require("./profiles/react"));
27
+ const _default1 = /*#__PURE__*/ _interop_require_wildcard(require("./flat-profiles/default"));
28
+ const _react1 = /*#__PURE__*/ _interop_require_wildcard(require("./flat-profiles/react"));
21
29
  function _getRequireWildcardCache(nodeInterop) {
22
30
  if (typeof WeakMap !== "function") return null;
23
31
  var cacheBabelInterop = new WeakMap();
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=default.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=react.d.ts.map
@@ -1,3 +1,5 @@
1
1
  export * as Default from './profiles/default';
2
2
  export * as React from './profiles/react';
3
+ export * as FlatDefault from './flat-profiles/default';
4
+ export * as FlatReact from './flat-profiles/react';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,99 @@
1
+ const webAppProfile = require('@rushstack/eslint-config/flat/profile/web-app');
2
+ const spfxPlugin = require('@microsoft/eslint-plugin-spfx');
3
+ const config = [
4
+ ...webAppProfile,
5
+ // Ignore generated SCSS type stubs and declaration files
6
+ {
7
+ ignores: [
8
+ '**/*.scss.ts',
9
+ '**/*.d.ts'
10
+ ]
11
+ },
12
+ // SPFx rules scoped to TypeScript files
13
+ {
14
+ files: [
15
+ '**/*.ts',
16
+ '**/*.tsx'
17
+ ],
18
+ plugins: {
19
+ '@microsoft/spfx': spfxPlugin
20
+ },
21
+ rules: {
22
+ // ---------------------------------------------------------------
23
+ // OVERRIDE rules: same rule as upstream @rushstack/eslint-config,
24
+ // but with SPFx-specific severity or options.
25
+ // ---------------------------------------------------------------
26
+ '@rushstack/hoist-jest-mock': 'warn',
27
+ '@typescript-eslint/explicit-member-accessibility': 'off',
28
+ '@typescript-eslint/no-floating-promises': 'error',
29
+ '@typescript-eslint/parameter-properties': 'off',
30
+ '@typescript-eslint/no-unused-vars': [
31
+ 'warn',
32
+ {
33
+ vars: 'all',
34
+ args: 'none'
35
+ }
36
+ ],
37
+ 'accessor-pairs': 'warn',
38
+ eqeqeq: 'warn',
39
+ 'no-extend-native': 'warn',
40
+ 'no-extra-boolean-cast': 'off',
41
+ 'no-sequences': 'warn',
42
+ 'no-void': 'warn',
43
+ // ---------------------------------------------------------------
44
+ // SPFx-ONLY rules: not present in upstream @rushstack/eslint-config.
45
+ // ---------------------------------------------------------------
46
+ '@rushstack/import-requires-chunk-name': 'warn',
47
+ '@rushstack/pair-react-dom-render-unmount': 'warn',
48
+ '@typescript-eslint/no-var-requires': 'error',
49
+ '@typescript-eslint/no-inferrable-types': 'off',
50
+ '@typescript-eslint/no-empty-interface': 'off',
51
+ '@microsoft/spfx/no-require-ensure': 'error',
52
+ // -------------------------------------------------------------------
53
+ // Upstream rules from @rushstack/eslint-config that are NOT currently
54
+ // enabled in SPFx generated projects (absent from both Heft and Gulp
55
+ // templates). Explicitly disabled to maintain behavioral parity.
56
+ // Reviewers: consider whether any of these should be enabled for SPFx.
57
+ // -------------------------------------------------------------------
58
+ // Requires local variables to have type annotations when the initializer
59
+ // is not a basic type (string, number, boolean).
60
+ '@rushstack/typedef-var': 'off',
61
+ // Requires type annotations on function parameters, member variables,
62
+ // and other declarations. Can be verbose for SPFx component code.
63
+ '@typescript-eslint/typedef': 'off',
64
+ // Enforces naming conventions (camelCase, PascalCase, etc.) on
65
+ // variables, functions, types, and other identifiers.
66
+ '@typescript-eslint/naming-convention': 'off',
67
+ // Enforces a consistent ordering of class members
68
+ // (fields, constructors, methods).
69
+ '@typescript-eslint/member-ordering': 'off',
70
+ // Enforces consistent use of type assertions (`as` vs angle-bracket).
71
+ '@typescript-eslint/consistent-type-assertions': 'off',
72
+ // Enforces consistent use of `interface` vs `type` for object type definitions.
73
+ '@typescript-eslint/consistent-type-definitions': 'off',
74
+ // Disallows the `Function` type in favor of more specific function signatures.
75
+ '@typescript-eslint/no-unsafe-function-type': 'off',
76
+ // Disallows `String`, `Number`, `Boolean` wrapper object types in favor
77
+ // of their lowercase primitives.
78
+ '@typescript-eslint/no-wrapper-object-types': 'off',
79
+ // Disallows bitwise operators (|, &, ^, ~, <<, >>). Catches accidental
80
+ // use of | instead of || and & instead of &&.
81
+ 'no-bitwise': 'off'
82
+ }
83
+ },
84
+ // Match the current legacy profile: disable these rules for TypeScript files
85
+ {
86
+ files: [
87
+ '**/*.ts',
88
+ '**/*.tsx'
89
+ ],
90
+ rules: {
91
+ '@typescript-eslint/no-require-imports': 'off',
92
+ '@typescript-eslint/no-empty-object-type': 'off'
93
+ }
94
+ }
95
+ ];
96
+ module.exports = config;
97
+ export { };
98
+
99
+ //# sourceMappingURL=./default.js.map
@@ -0,0 +1,29 @@
1
+ const reactHooksPlugin = require('eslint-plugin-react-hooks');
2
+ const reactMixin = require('@rushstack/eslint-config/flat/mixins/react');
3
+ const defaultProfile = require('./default');
4
+ const config = [
5
+ ...defaultProfile,
6
+ ...reactMixin,
7
+ {
8
+ files: [
9
+ '**/*.ts',
10
+ '**/*.tsx'
11
+ ],
12
+ plugins: {
13
+ 'react-hooks': reactHooksPlugin
14
+ }
15
+ },
16
+ // SPFx override: allow inline arrow functions in JSX props
17
+ {
18
+ files: [
19
+ '**/*.tsx'
20
+ ],
21
+ rules: {
22
+ 'react/jsx-no-bind': 'off'
23
+ }
24
+ }
25
+ ];
26
+ module.exports = config;
27
+ export { };
28
+
29
+ //# sourceMappingURL=./react.js.map
package/lib-esm/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  export * as Default from './profiles/default';
2
2
  export * as React from './profiles/react';
3
+ export * as FlatDefault from './flat-profiles/default';
4
+ export * as FlatReact from './flat-profiles/react';
3
5
 
4
6
  //# sourceMappingURL=./index.js.map
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@microsoft/eslint-config-spfx",
3
- "version": "1.22.1",
3
+ "version": "1.23.0-beta.0",
4
4
  "description": "ESLint profiles for SharePoint Framework solutions",
5
- "license": "https://aka.ms/spfx/license",
6
5
  "homepage": "http://aka.ms/spfx",
6
+ "license": "https://aka.ms/spfx/license",
7
+ "engines": {
8
+ "node": ">=18.17.1 <19.0.0 || >=22.14.0 < 23.0.0"
9
+ },
7
10
  "main": "lib-commonjs/index.js",
8
11
  "module": "lib-esm/index.js",
9
12
  "typings": "lib-dts/index.d.ts",
@@ -27,22 +30,22 @@
27
30
  ]
28
31
  }
29
32
  },
30
- "engines": {
31
- "node": ">=18.17.1 <19.0.0 || >=22.14.0 < 23.0.0"
32
- },
33
33
  "dependencies": {
34
- "@rushstack/eslint-config": "4.5.2",
35
- "@rushstack/eslint-plugin": "0.22.0",
36
- "@typescript-eslint/eslint-plugin": "8.46.2",
37
- "@typescript-eslint/utils": "8.46.2",
38
- "@microsoft/eslint-plugin-spfx": "1.22.1"
34
+ "@rushstack/eslint-config": "4.6.4",
35
+ "@rushstack/eslint-plugin": "0.23.2",
36
+ "@typescript-eslint/eslint-plugin": "8.56.1",
37
+ "@typescript-eslint/parser": "8.56.1",
38
+ "@typescript-eslint/utils": "8.56.1",
39
+ "eslint-plugin-promise": "~7.2.1",
40
+ "eslint-plugin-react-hooks": "5.2.0",
41
+ "@microsoft/eslint-plugin-spfx": "1.23.0-beta.0"
39
42
  },
40
43
  "peerDependencies": {
41
- "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
44
+ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0"
42
45
  },
43
46
  "devDependencies": {
44
- "@rushstack/heft": "1.1.2",
45
- "eslint": "8.57.1",
47
+ "@rushstack/heft": "1.2.7",
48
+ "eslint": "9.37.0",
46
49
  "typescript": "5.3.3",
47
50
  "@msinternal/internal-node-rig": "0.1.0"
48
51
  },