@australiangreens/eslint-plugin-ag-internal 0.0.1
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/LICENSE +21 -0
- package/README.md +2 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +75 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 The Australian Greens
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import jsEslint from '@eslint/js';
|
|
2
|
+
import eslintConfigPrettier from 'eslint-config-prettier/flat';
|
|
3
|
+
import importPlugin from 'eslint-plugin-import';
|
|
4
|
+
import { defineConfig } from 'eslint/config';
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import tsEslint from 'typescript-eslint';
|
|
7
|
+
// '../package.json' be correct both in src/ and dist/
|
|
8
|
+
const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
|
9
|
+
const plugin = {
|
|
10
|
+
meta: {
|
|
11
|
+
name: pkg.name,
|
|
12
|
+
version: pkg.version,
|
|
13
|
+
},
|
|
14
|
+
configs: {
|
|
15
|
+
recommended: defineConfig([
|
|
16
|
+
{
|
|
17
|
+
name: 'js',
|
|
18
|
+
extends: [jsEslint.configs.recommended],
|
|
19
|
+
rules: {
|
|
20
|
+
// Not enabled in recommended, we prefer to be more specific
|
|
21
|
+
radix: ['error', 'as-needed'],
|
|
22
|
+
// Not enabled in recommended, we treat it as an error
|
|
23
|
+
'no-plusplus': [
|
|
24
|
+
'error',
|
|
25
|
+
{
|
|
26
|
+
allowForLoopAfterthoughts: true,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'ts',
|
|
33
|
+
// It exports a named config object, but that causes errors
|
|
34
|
+
// eslint-disable-next-line import/no-named-as-default-member
|
|
35
|
+
extends: [tsEslint.configs.recommended],
|
|
36
|
+
rules: {
|
|
37
|
+
// Not enabled in recommended
|
|
38
|
+
'@typescript-eslint/no-use-before-define': [
|
|
39
|
+
'error',
|
|
40
|
+
{
|
|
41
|
+
variables: true,
|
|
42
|
+
functions: false,
|
|
43
|
+
classes: false,
|
|
44
|
+
enums: true,
|
|
45
|
+
typedefs: true,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
// It can be useful to effectively re-export the props of another
|
|
49
|
+
// component for some wrappers. E.g. SaladBarProviderProps is same as
|
|
50
|
+
// SnackbarProps
|
|
51
|
+
'@typescript-eslint/no-empty-interface': 'off',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
// Linting of ES6+ import/export syntax
|
|
56
|
+
name: 'import',
|
|
57
|
+
extends: [importPlugin.flatConfigs.recommended, importPlugin.flatConfigs.typescript],
|
|
58
|
+
rules: {
|
|
59
|
+
'import/newline-after-import': 'error',
|
|
60
|
+
'import/no-unresolved': 'error',
|
|
61
|
+
},
|
|
62
|
+
settings: {
|
|
63
|
+
'import/resolver': {
|
|
64
|
+
typescript: true,
|
|
65
|
+
node: true,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
// Turns off all rules that are unnecessary or might conflict with Prettier,
|
|
70
|
+
// which we use for formatting.
|
|
71
|
+
eslintConfigPrettier,
|
|
72
|
+
]),
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
export default plugin;
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@australiangreens/eslint-plugin-ag-internal",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"homepage": "https://github.com/australiangreens/eslint-plugin-ag-internal#readme",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/australiangreens/eslint-plugin-ag-internal"
|
|
10
|
+
},
|
|
11
|
+
"description": "Internal linting configuration",
|
|
12
|
+
"author": "The Australian Greens <webops@greens.org.au>",
|
|
13
|
+
"contributors": [
|
|
14
|
+
"Anthony Blond <anthony@unfinishedteleporter.com>"
|
|
15
|
+
],
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"scripts": {
|
|
25
|
+
"eslint": "eslint --max-warnings 0",
|
|
26
|
+
"build": "tsc --build",
|
|
27
|
+
"build:watch": "tsc --build --watch",
|
|
28
|
+
"clean": "rm -rf dist",
|
|
29
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@eslint/js": "^9.36.0",
|
|
33
|
+
"@types/node": "^24.5.2",
|
|
34
|
+
"eslint": "^9.26.0",
|
|
35
|
+
"eslint-config-prettier": "^10.1.8",
|
|
36
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
37
|
+
"eslint-plugin-eslint-plugin": "^7.0.0",
|
|
38
|
+
"eslint-plugin-import": "^2.32.0",
|
|
39
|
+
"globals": "^16.4.0",
|
|
40
|
+
"typescript": "^5.9.2",
|
|
41
|
+
"typescript-eslint": "^8.44.1"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"eslint": ">=9.26.0"
|
|
45
|
+
},
|
|
46
|
+
"keywords": [
|
|
47
|
+
"eslint",
|
|
48
|
+
"eslintplugin",
|
|
49
|
+
"eslint-plugin"
|
|
50
|
+
],
|
|
51
|
+
"packageManager": "pnpm@10.15.1",
|
|
52
|
+
"files": [
|
|
53
|
+
"dist",
|
|
54
|
+
"!**/*.tsbuildinfo",
|
|
55
|
+
"README.md",
|
|
56
|
+
"LICENSE"
|
|
57
|
+
]
|
|
58
|
+
}
|