Skip to content

Commit 84d3dc5

Browse files
fix: upgrade eslint config away from abandoned plugin (#643)
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent ae8d8bb commit 84d3dc5

38 files changed

+1410
-733
lines changed

.eslintrc.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/autogen/.eslintrc.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* Copyright (C) 2024 Hedera Hashgraph, LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the ""License"");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an ""AS IS"" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
import globals from 'globals'
18+
import path from 'node:path'
19+
import { fileURLToPath } from 'node:url'
20+
import js from '@eslint/js'
21+
import { FlatCompat } from '@eslint/eslintrc'
22+
23+
const __filename = fileURLToPath(import.meta.url)
24+
const __dirname = path.dirname(__filename)
25+
const compat = new FlatCompat({
26+
baseDirectory: __dirname,
27+
recommendedConfig: js.configs.recommended,
28+
allConfig: js.configs.all
29+
})
30+
31+
export default [...compat.extends('standard'), {
32+
languageOptions: {
33+
globals: {
34+
...globals.browser
35+
},
36+
37+
ecmaVersion: 'latest',
38+
sourceType: 'module'
39+
},
40+
41+
rules: {
42+
'no-template-curly-in-string': 'off'
43+
}
44+
}, {
45+
files: ['**/*.mjs'],
46+
47+
languageOptions: {
48+
ecmaVersion: 'latest',
49+
sourceType: 'module'
50+
}
51+
}]

.github/workflows/flow-deploy-release-artifact.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
8888
update-readme:
8989
name: "Update README.md"
90-
uses: ./.github/workflows/flow-update-readme.yaml
90+
uses: ./.github/workflows/zxc-update-readme.yaml
9191
needs:
9292
- prepare-release
9393
with:

.github/workflows/flow-pull-request-checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454

5555
update-readme:
5656
name: "Update README.md"
57-
uses: ./.github/workflows/flow-update-readme.yaml
57+
uses: ./.github/workflows/zxc-update-readme.yaml
5858
with:
5959
commit-changes: false
6060
secrets:

.github/workflows/flow-update-readme.yaml renamed to .github/workflows/zxc-update-readme.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ on:
4141
commit-hash:
4242
description: "The commit hash for the updated README.md commit"
4343
value: ${{ jobs.update.outputs.commit_hash }}
44-
push:
45-
paths:
46-
- '**/*.mjs'
47-
- '**/*.js'
48-
- '**/package*.json'
49-
- '**/README.md.template'
5044

5145
defaults:
5246
run:

eslint.config.mjs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/**
2+
* Copyright (C) 2024 Hedera Hashgraph, LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the ""License"");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an ""AS IS"" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
import headers from 'eslint-plugin-headers'
18+
import globals from 'globals'
19+
import path from 'node:path'
20+
import { fileURLToPath } from 'node:url'
21+
import js from '@eslint/js'
22+
import { FlatCompat } from '@eslint/eslintrc'
23+
const __filename = fileURLToPath(import.meta.url)
24+
const __dirname = path.dirname(__filename)
25+
const compat = new FlatCompat({
26+
baseDirectory: __dirname,
27+
recommendedConfig: js.configs.recommended,
28+
allConfig: js.configs.all
29+
})
30+
export default [...compat.extends('standard'), {
31+
files: ['**/*.mjs'],
32+
plugins: {
33+
headers
34+
},
35+
languageOptions: {
36+
globals: {
37+
...globals.browser,
38+
...globals.jest
39+
},
40+
ecmaVersion: 'latest',
41+
sourceType: 'module'
42+
},
43+
rules: {
44+
'no-unused-expressions': 'error',
45+
'no-unused-vars': 'error',
46+
'require-await': 'error',
47+
'no-template-curly-in-string': 'off',
48+
'headers/header-format': ['error', {
49+
source: 'string',
50+
variables: {
51+
year: '2024'
52+
},
53+
content: 'Copyright (C) {year} Hedera Hashgraph, LLC\n\nLicensed under the Apache License, Version 2.0 (the ""License"");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an ""AS IS"" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n'
54+
}]
55+
}
56+
}]

0 commit comments

Comments
 (0)