@microsoft/eslint-config-spfx 1.22.2 → 1.23.0-beta.2

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,106 @@
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-inferrable-types': 'off',
53
+ '@typescript-eslint/no-empty-interface': 'off',
54
+ '@microsoft/spfx/no-require-ensure': 'error',
55
+ // -------------------------------------------------------------------
56
+ // Upstream rules from @rushstack/eslint-config that are NOT currently
57
+ // enabled in SPFx generated projects (absent from both Heft and Gulp
58
+ // templates). Explicitly disabled to maintain behavioral parity.
59
+ // Reviewers: consider whether any of these should be enabled for SPFx.
60
+ // -------------------------------------------------------------------
61
+ // Requires local variables to have type annotations when the initializer
62
+ // is not a basic type (string, number, boolean).
63
+ '@rushstack/typedef-var': 'off',
64
+ // Requires type annotations on function parameters, member variables,
65
+ // and other declarations. Can be verbose for SPFx component code.
66
+ '@typescript-eslint/typedef': 'off',
67
+ // Enforces naming conventions (camelCase, PascalCase, etc.) on
68
+ // variables, functions, types, and other identifiers.
69
+ '@typescript-eslint/naming-convention': 'off',
70
+ // Enforces a consistent ordering of class members
71
+ // (fields, constructors, methods).
72
+ '@typescript-eslint/member-ordering': 'off',
73
+ // Enforces consistent use of type assertions (`as` vs angle-bracket).
74
+ '@typescript-eslint/consistent-type-assertions': 'off',
75
+ // Enforces consistent use of `interface` vs `type` for object type definitions.
76
+ '@typescript-eslint/consistent-type-definitions': 'off',
77
+ // Disallows the `Function` type in favor of more specific function signatures.
78
+ '@typescript-eslint/no-unsafe-function-type': 'off',
79
+ // Disallows `String`, `Number`, `Boolean` wrapper object types in favor
80
+ // of their lowercase primitives.
81
+ '@typescript-eslint/no-wrapper-object-types': 'off',
82
+ // Disallows bitwise operators (|, &, ^, ~, <<, >>). Catches accidental
83
+ // use of | instead of || and & instead of &&.
84
+ 'no-bitwise': 'off'
85
+ }
86
+ },
87
+ // Match the current legacy profile: adjust these rules for TypeScript files
88
+ {
89
+ files: [
90
+ '**/*.ts',
91
+ '**/*.tsx'
92
+ ],
93
+ rules: {
94
+ '@typescript-eslint/no-require-imports': [
95
+ 'error',
96
+ {
97
+ allowAsImport: true
98
+ }
99
+ ],
100
+ '@typescript-eslint/no-empty-object-type': 'off'
101
+ }
102
+ }
103
+ ];
104
+ module.exports = config;
105
+
106
+ //# 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,103 @@
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-inferrable-types': 'off',
49
+ '@typescript-eslint/no-empty-interface': 'off',
50
+ '@microsoft/spfx/no-require-ensure': 'error',
51
+ // -------------------------------------------------------------------
52
+ // Upstream rules from @rushstack/eslint-config that are NOT currently
53
+ // enabled in SPFx generated projects (absent from both Heft and Gulp
54
+ // templates). Explicitly disabled to maintain behavioral parity.
55
+ // Reviewers: consider whether any of these should be enabled for SPFx.
56
+ // -------------------------------------------------------------------
57
+ // Requires local variables to have type annotations when the initializer
58
+ // is not a basic type (string, number, boolean).
59
+ '@rushstack/typedef-var': 'off',
60
+ // Requires type annotations on function parameters, member variables,
61
+ // and other declarations. Can be verbose for SPFx component code.
62
+ '@typescript-eslint/typedef': 'off',
63
+ // Enforces naming conventions (camelCase, PascalCase, etc.) on
64
+ // variables, functions, types, and other identifiers.
65
+ '@typescript-eslint/naming-convention': 'off',
66
+ // Enforces a consistent ordering of class members
67
+ // (fields, constructors, methods).
68
+ '@typescript-eslint/member-ordering': 'off',
69
+ // Enforces consistent use of type assertions (`as` vs angle-bracket).
70
+ '@typescript-eslint/consistent-type-assertions': 'off',
71
+ // Enforces consistent use of `interface` vs `type` for object type definitions.
72
+ '@typescript-eslint/consistent-type-definitions': 'off',
73
+ // Disallows the `Function` type in favor of more specific function signatures.
74
+ '@typescript-eslint/no-unsafe-function-type': 'off',
75
+ // Disallows `String`, `Number`, `Boolean` wrapper object types in favor
76
+ // of their lowercase primitives.
77
+ '@typescript-eslint/no-wrapper-object-types': 'off',
78
+ // Disallows bitwise operators (|, &, ^, ~, <<, >>). Catches accidental
79
+ // use of | instead of || and & instead of &&.
80
+ 'no-bitwise': 'off'
81
+ }
82
+ },
83
+ // Match the current legacy profile: adjust these rules for TypeScript files
84
+ {
85
+ files: [
86
+ '**/*.ts',
87
+ '**/*.tsx'
88
+ ],
89
+ rules: {
90
+ '@typescript-eslint/no-require-imports': [
91
+ 'error',
92
+ {
93
+ allowAsImport: true
94
+ }
95
+ ],
96
+ '@typescript-eslint/no-empty-object-type': 'off'
97
+ }
98
+ }
99
+ ];
100
+ module.exports = config;
101
+ export { };
102
+
103
+ //# 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.2",
3
+ "version": "1.23.0-beta.2",
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,23 @@
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.2"
34
+ "@rushstack/eslint-config": "4.6.4",
35
+ "@rushstack/eslint-plugin": "0.23.2",
36
+ "@rushstack/eslint-plugin-security": "0.14.2",
37
+ "@typescript-eslint/eslint-plugin": "8.56.1",
38
+ "@typescript-eslint/parser": "8.56.1",
39
+ "@typescript-eslint/utils": "8.56.1",
40
+ "eslint-plugin-promise": "~7.2.1",
41
+ "eslint-plugin-react-hooks": "5.2.0",
42
+ "@microsoft/eslint-plugin-spfx": "1.23.0-beta.2"
39
43
  },
40
44
  "peerDependencies": {
41
- "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
45
+ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0"
42
46
  },
43
47
  "devDependencies": {
44
- "@rushstack/heft": "1.1.2",
45
- "eslint": "8.57.1",
48
+ "@rushstack/heft": "1.2.7",
49
+ "eslint": "9.37.0",
46
50
  "typescript": "5.3.3",
47
51
  "@msinternal/internal-node-rig": "0.1.0"
48
52
  },