@microsoft/eslint-config-spfx 1.15.0-rc.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.
Files changed (54) hide show
  1. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Basque.docx +0 -0
  2. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Bulgarian.docx +0 -0
  3. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Catalan.docx +0 -0
  4. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Chinese (Simplified).docx +0 -0
  5. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Chinese (Traditional).docx +0 -0
  6. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Croatian.docx +0 -0
  7. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Czech.docx +0 -0
  8. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Danish.docx +0 -0
  9. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Dutch.docx +0 -0
  10. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Estonian.docx +0 -0
  11. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Finnish.docx +0 -0
  12. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - French.docx +0 -0
  13. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Galician.docx +0 -0
  14. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - German.docx +0 -0
  15. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Greek.docx +0 -0
  16. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Hindi.docx +0 -0
  17. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Hungarian.docx +0 -0
  18. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Indonesian.docx +0 -0
  19. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Italian.docx +0 -0
  20. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Japanese.docx +0 -0
  21. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Kazakh.docx +0 -0
  22. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Korean.docx +0 -0
  23. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Latvian.docx +0 -0
  24. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Lithuanian.docx +0 -0
  25. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Malaysian.docx +0 -0
  26. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Norwegian.docx +0 -0
  27. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Polish.docx +0 -0
  28. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Portuguese (Brazil).docx +0 -0
  29. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Portuguese (Portugal).docx +0 -0
  30. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Romanian.docx +0 -0
  31. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Russian.docx +0 -0
  32. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Serbian (Cyrillic).docx +0 -0
  33. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Serbian (Latin).docx +0 -0
  34. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Slovak.docx +0 -0
  35. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Slovenian.docx +0 -0
  36. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Spanish.docx +0 -0
  37. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Swedish.docx +0 -0
  38. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Thai.docx +0 -0
  39. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Turkish.docx +0 -0
  40. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Ukrainian.docx +0 -0
  41. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Valencian.docx +0 -0
  42. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms - Vietnamese.docx +0 -0
  43. package/EULA/Microsoft Sharepoint Framework - Standalone (free) Use Terms.docx +0 -0
  44. package/README.md +10 -0
  45. package/lib/index.d.ts +3 -0
  46. package/lib/index.d.ts.map +1 -0
  47. package/lib/index.js +11 -0
  48. package/lib/profiles/default.d.ts +6 -0
  49. package/lib/profiles/default.d.ts.map +1 -0
  50. package/lib/profiles/default.js +68 -0
  51. package/lib/profiles/react.d.ts +6 -0
  52. package/lib/profiles/react.d.ts.map +1 -0
  53. package/lib/profiles/react.js +77 -0
  54. package/package.json +19 -0
package/README.md ADDED
@@ -0,0 +1,10 @@
1
+ # eslint-config-spfx
2
+
3
+ This package defines custom [ESLint](https://eslint.org/) rules for usage
4
+ with SharePoint client-side projects.
5
+
6
+ *This package is part of the [SharePoint Framework](http://aka.ms/spfx),
7
+ which is a collection of NPM packages that empower developers to create client-side experiences
8
+ for [Microsoft SharePoint](https://products.office.com/en-us/sharepoint/collaboration).
9
+ For more information, including complete API documentation and code samples, please visit
10
+ the [SharePoint Framework](http://aka.ms/spfx) web site.*
package/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export { default as Default } from './profiles/default';
2
+ export { default as React } from './profiles/react';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.React = exports.Default = void 0;
7
+ var default_1 = require("./profiles/default");
8
+ Object.defineProperty(exports, "Default", { enumerable: true, get: function () { return __importDefault(default_1).default; } });
9
+ var react_1 = require("./profiles/react");
10
+ Object.defineProperty(exports, "React", { enumerable: true, get: function () { return __importDefault(react_1).default; } });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ import { TSESLint } from '@typescript-eslint/experimental-utils';
2
+ declare const config: Partial<TSESLint.Linter.ConfigOverride & {
3
+ ignorePatterns: string[];
4
+ }>;
5
+ export = config;
6
+ //# sourceMappingURL=default.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/profiles/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAEjE,QAAA,MAAM,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,GAAG;IAAE,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CAkElF,CAAC;AAEF,SAAS,MAAM,CAAC"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ const config = {
3
+ extends: ['@rushstack/eslint-config/profile/web-app', '@rushstack/eslint-config/mixins/friendly-locals'],
4
+ plugins: ['@microsoft/eslint-plugin-spfx'],
5
+ ignorePatterns: ['*.scss.ts'],
6
+ overrides: [
7
+ {
8
+ files: ['*.ts', '*.tsx'],
9
+ rules: {
10
+ 'no-extra-boolean-cast': 'off',
11
+ // ====================================================================
12
+ // @microsoft/eslint-plugin-spfx
13
+ // ====================================================================
14
+ '@microsoft/spfx/import-requires-chunk-name': 'warn',
15
+ '@microsoft/spfx/no-async-await': 'warn',
16
+ '@microsoft/spfx/no-require-ensure': 'error',
17
+ '@microsoft/spfx/pair-react-dom-render-unmount': 'warn'
18
+ }
19
+ },
20
+ {
21
+ // For unit tests, we can be a little bit less strict. The settings below revise the
22
+ // defaults specified in the extended configurations, as well as above.
23
+ files: [
24
+ // Test files
25
+ '*.test.ts',
26
+ '*.test.tsx',
27
+ '*.spec.ts',
28
+ '*.spec.tsx',
29
+ // Facebook convention
30
+ '**/__mocks__/*.ts',
31
+ '**/__mocks__/*.tsx',
32
+ '**/__tests__/*.ts',
33
+ '**/__tests__/*.tsx',
34
+ // Microsoft convention
35
+ '**/test/*.ts',
36
+ '**/test/*.tsx'
37
+ ],
38
+ rules: {
39
+ 'class-name': 0,
40
+ 'export-name': 0,
41
+ forin: 0,
42
+ 'label-position': 0,
43
+ 'member-access': 2,
44
+ 'no-arg': 0,
45
+ 'no-console': 0,
46
+ 'no-construct': 0,
47
+ 'no-duplicate-variable': 2,
48
+ 'no-eval': 0,
49
+ 'no-function-expression': 2,
50
+ 'no-internal-module': 2,
51
+ 'no-shadowed-variable': 2,
52
+ 'no-switch-case-fall-through': 2,
53
+ 'no-unnecessary-semicolons': 2,
54
+ 'no-unused-expression': 2,
55
+ 'no-with-statement': 2,
56
+ semicolon: 2,
57
+ 'trailing-comma': 0,
58
+ typedef: 0,
59
+ 'typedef-whitespace': 0,
60
+ 'use-named-parameter': 2,
61
+ 'variable-name': 0,
62
+ whitespace: 0
63
+ }
64
+ }
65
+ ]
66
+ };
67
+ module.exports = config;
68
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1,6 @@
1
+ import { TSESLint } from '@typescript-eslint/experimental-utils';
2
+ declare const config: Partial<TSESLint.Linter.ConfigOverride & {
3
+ ignorePatterns: string[];
4
+ }>;
5
+ export = config;
6
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/profiles/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAEjE,QAAA,MAAM,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,GAAG;IAAE,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CA2ElF,CAAC;AAEF,SAAS,MAAM,CAAC"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ const config = {
3
+ extends: [
4
+ '@rushstack/eslint-config/profile/web-app',
5
+ '@rushstack/eslint-config/mixins/react',
6
+ '@rushstack/eslint-config/mixins/friendly-locals'
7
+ ],
8
+ plugins: ['@microsoft/eslint-plugin-spfx', 'eslint-plugin-react-hooks'],
9
+ ignorePatterns: ['*.scss.ts'],
10
+ overrides: [
11
+ {
12
+ files: ['*.ts', '*.tsx'],
13
+ rules: {
14
+ 'no-extra-boolean-cast': 'off',
15
+ // ====================================================================
16
+ // @microsoft/eslint-plugin-spfx
17
+ // ====================================================================
18
+ '@microsoft/spfx/import-requires-chunk-name': 'warn',
19
+ '@microsoft/spfx/no-async-await': 'warn',
20
+ '@microsoft/spfx/no-require-ensure': 'error',
21
+ '@microsoft/spfx/pair-react-dom-render-unmount': 'warn',
22
+ // =====================================================================
23
+ // eslint-plugin-react-hooks
24
+ // =====================================================================
25
+ 'react-hooks/rules-of-hooks': 'error',
26
+ 'react-hooks/exhaustive-deps': 'warn'
27
+ }
28
+ },
29
+ {
30
+ // For unit tests, we can be a little bit less strict. The settings below revise the
31
+ // defaults specified in the extended configurations, as well as above.
32
+ files: [
33
+ // Test files
34
+ '*.test.ts',
35
+ '*.test.tsx',
36
+ '*.spec.ts',
37
+ '*.spec.tsx',
38
+ // Facebook convention
39
+ '**/__mocks__/*.ts',
40
+ '**/__mocks__/*.tsx',
41
+ '**/__tests__/*.ts',
42
+ '**/__tests__/*.tsx',
43
+ // Microsoft convention
44
+ '**/test/*.ts',
45
+ '**/test/*.tsx'
46
+ ],
47
+ rules: {
48
+ 'class-name': 0,
49
+ 'export-name': 0,
50
+ forin: 0,
51
+ 'label-position': 0,
52
+ 'member-access': 2,
53
+ 'no-arg': 0,
54
+ 'no-console': 0,
55
+ 'no-construct': 0,
56
+ 'no-duplicate-variable': 2,
57
+ 'no-eval': 0,
58
+ 'no-function-expression': 2,
59
+ 'no-internal-module': 2,
60
+ 'no-shadowed-variable': 2,
61
+ 'no-switch-case-fall-through': 2,
62
+ 'no-unnecessary-semicolons': 2,
63
+ 'no-unused-expression': 2,
64
+ 'no-with-statement': 2,
65
+ semicolon: 2,
66
+ 'trailing-comma': 0,
67
+ typedef: 0,
68
+ 'typedef-whitespace': 0,
69
+ 'use-named-parameter': 2,
70
+ 'variable-name': 0,
71
+ whitespace: 0
72
+ }
73
+ }
74
+ ]
75
+ };
76
+ module.exports = config;
77
+ //# sourceMappingURL=react.js.map
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@microsoft/eslint-config-spfx",
3
+ "version": "1.15.0-rc.0",
4
+ "description": "ESLint rules for SharePoint Framework solutions",
5
+ "license": "SEE LICENSE IN \"EULA\" FOLDER",
6
+ "homepage": "http://aka.ms/spfx",
7
+ "main": "lib/index.js",
8
+ "typings": "lib/index.d.ts",
9
+ "scripts": {},
10
+ "engines": {
11
+ "node": ">=12.13.0 <13.0.0 || >=14.15.0 <15.0.0 || >=16.13.0 <17.0.0"
12
+ },
13
+ "dependencies": {
14
+ "@typescript-eslint/experimental-utils": "5.20.0"
15
+ },
16
+ "peerDependencies": {
17
+ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
18
+ }
19
+ }