@australiangreens/eslint-plugin-ag-internal 0.2.1 → 0.3.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.
package/README.md CHANGED
@@ -60,9 +60,6 @@ _warnings_. This may be changed in the future.
60
60
  - [import plugin](https://www.npmjs.com/package/eslint-plugin-import-esm)'s
61
61
  recommended rules with the addition of 2 strict rules.
62
62
 
63
- - [import](https://www.npmjs.com/package/eslint-plugin-import-esm)
64
- typescript rules. **TODO: Move to typescript config**.
65
-
66
63
  ### recommended
67
64
 
68
65
  All the rules from recommendedJsOnly with the addition of the following:
@@ -73,6 +70,9 @@ All the rules from recommendedJsOnly with the addition of the following:
73
70
  - [tsdoc plugin](https://www.npmjs.com/package/eslint-plugin-tsdoc)'s single
74
71
  `tsdoc/syntax` rule enabled as _error_.
75
72
 
73
+ - [import](https://www.npmjs.com/package/eslint-plugin-import-esm)
74
+ typescript rules.
75
+
76
76
  ## recommendedReactJsOnly
77
77
 
78
78
  recommendedJsOnly with the addition of the following:
@@ -1,3 +1,4 @@
1
1
  import { Linter } from 'eslint';
2
- declare const config: Linter.Config[];
3
- export default config;
2
+ export declare const importPluginChange: Linter.Config;
3
+ declare const _default: Linter.Config<Linter.RulesRecord>[];
4
+ export default _default;
@@ -1,7 +1,7 @@
1
1
  import jsEslint from '@eslint/js';
2
2
  import importPlugin from 'eslint-plugin-import';
3
3
  import { pluginName } from '../util.js';
4
- const config = [
4
+ const javascriptRulesMinusImportPluginChange = [
5
5
  jsEslint.configs.recommended,
6
6
  {
7
7
  name: `${pluginName()}/eslint`,
@@ -18,25 +18,19 @@ const config = [
18
18
  },
19
19
  },
20
20
  importPlugin.flatConfigs.recommended,
21
- // TODO: Is it possible to move the typescript stuff out of here and still work?
22
- importPlugin.flatConfigs.typescript,
23
- {
24
- name: `${pluginName()}/import`,
25
- rules: {
26
- // These are not incuded in the recommended config, we treat as errors
27
- 'import/newline-after-import': 'error',
28
- 'import/no-unresolved': 'error',
29
- // These are warnings in recommended, we treat as errors
30
- 'import/no-named-as-default': 'error',
31
- 'import/no-named-as-default-member': 'error',
32
- 'import/no-duplicates': 'error',
33
- },
34
- settings: {
35
- 'import/resolver': {
36
- typescript: true,
37
- node: true,
38
- },
39
- },
40
- },
41
21
  ];
42
- export default config;
22
+ // We use this pattern so we don't need to define the rules both here and in
23
+ // typescript.ts
24
+ export const importPluginChange = {
25
+ name: `${pluginName()}/import`,
26
+ rules: {
27
+ // These are not incuded in the recommended config, we treat as errors
28
+ 'import/newline-after-import': 'error',
29
+ 'import/no-unresolved': 'error',
30
+ // These are warnings in recommended, we treat as errors
31
+ 'import/no-named-as-default': 'error',
32
+ 'import/no-named-as-default-member': 'error',
33
+ 'import/no-duplicates': 'error',
34
+ },
35
+ };
36
+ export default [...javascriptRulesMinusImportPluginChange, importPluginChange];
@@ -1,6 +1,8 @@
1
+ import importPlugin from 'eslint-plugin-import';
1
2
  import tsdocPlugin from 'eslint-plugin-tsdoc';
2
3
  import { configs as tsEslintConfigs } from 'typescript-eslint';
3
4
  import { pluginName } from '../util.js';
5
+ import { importPluginChange } from './javascript.js';
4
6
  const config = [
5
7
  ...tsEslintConfigs.recommended,
6
8
  {
@@ -36,5 +38,15 @@ const config = [
36
38
  'tsdoc/syntax': 'error',
37
39
  },
38
40
  },
41
+ importPlugin.flatConfigs.typescript,
42
+ {
43
+ ...importPluginChange,
44
+ settings: {
45
+ 'import/resolver': {
46
+ typescript: true,
47
+ node: true,
48
+ },
49
+ },
50
+ },
39
51
  ];
40
52
  export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@australiangreens/eslint-plugin-ag-internal",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/australiangreens/eslint-plugin-ag-internal#readme",