@microsoft/eslint-config-spfx 1.15.0 → 1.15.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.
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # eslint-config-spfx
2
2
 
3
- This package defines custom [ESLint](https://eslint.org/) rules for usage
4
- with SharePoint client-side projects.
3
+ This package defines basic [ESLint](https://eslint.org/) profiles for SharePoint client-side projects.
5
4
 
6
5
  *This package is part of the [SharePoint Framework](http://aka.ms/spfx),
7
6
  which is a collection of NPM packages that empower developers to create client-side experiences
@@ -1,5 +1,6 @@
1
1
  import { TSESLint } from '@typescript-eslint/experimental-utils';
2
2
  declare const config: Partial<TSESLint.Linter.ConfigOverride & {
3
+ root: boolean;
3
4
  ignorePatterns: string[];
4
5
  }>;
5
6
  export = config;
@@ -1 +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"}
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,IAAI,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CAYjG,CAAC;AAEF,SAAS,MAAM,CAAC"}
@@ -1,68 +1,16 @@
1
1
  "use strict";
2
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
- ]
3
+ root: true,
4
+ parser: '',
5
+ plugins: [
6
+ '@rushstack/eslint-plugin',
7
+ '@rushstack/eslint-plugin-security',
8
+ '@typescript-eslint/eslint-plugin',
9
+ 'eslint-plugin-promise',
10
+ '@microsoft/eslint-plugin-spfx'
11
+ ],
12
+ extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
13
+ ignorePatterns: ['*.scss.ts', '*.d.ts']
66
14
  };
67
15
  module.exports = config;
68
16
  //# sourceMappingURL=default.js.map
@@ -1 +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"}
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,CAWlF,CAAC;AAEF,SAAS,MAAM,CAAC"}
@@ -1,74 +1,12 @@
1
1
  "use strict";
2
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'],
3
+ extends: ['./default', '@rushstack/eslint-config/mixins/react'],
4
+ plugins: ['eslint-plugin-react-hooks'],
10
5
  overrides: [
11
6
  {
12
- files: ['*.ts', '*.tsx'],
7
+ files: ['*.tsx'],
13
8
  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
9
+ 'react/jsx-no-bind': 'off'
72
10
  }
73
11
  }
74
12
  ]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@microsoft/eslint-config-spfx",
3
- "version": "1.15.0",
4
- "description": "ESLint rules for SharePoint Framework solutions",
3
+ "version": "1.15.2",
4
+ "description": "ESLint profiles for SharePoint Framework solutions",
5
5
  "license": "SEE LICENSE IN \"EULA\" FOLDER",
6
6
  "homepage": "http://aka.ms/spfx",
7
7
  "main": "lib/index.js",