-
Notifications
You must be signed in to change notification settings - Fork 28
chore: update eslint #298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
chore: update eslint #298
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| import { defineConfig, globalIgnores } from 'eslint/config' | ||
| import eslintPluginImport from 'eslint-plugin-import' | ||
| import eslintPluginN from 'eslint-plugin-n' | ||
| import eslintPluginPromise from 'eslint-plugin-promise' | ||
| import globals from 'globals' | ||
| import standard from 'eslint-config-standard' | ||
| import tseslint from 'typescript-eslint' | ||
|
|
||
| export default defineConfig([ | ||
| { | ||
| languageOptions: { | ||
| parserOptions: { | ||
| ecmaFeatures: standard.parserOptions.ecmaFeatures, | ||
| ecmaVersion: 2022 | ||
| }, | ||
| globals: { | ||
| ...globals.es2021, | ||
| ...globals.node, | ||
| document: 'readonly', | ||
| navigator: 'readonly', | ||
| window: 'readonly' | ||
| } | ||
| }, | ||
| name: 'zcli/standard', | ||
| plugins: { | ||
| import: eslintPluginImport, | ||
| n: eslintPluginN, | ||
| promise: eslintPluginPromise | ||
| }, | ||
| rules: { | ||
| ...standard.rules, | ||
| 'no-unused-expressions': ['error', { | ||
| allowShortCircuit: true, | ||
| allowTernary: true, | ||
| allowTaggedTemplates: true | ||
| }] | ||
| } | ||
| }, | ||
| { | ||
| extends: [tseslint.configs.recommended], | ||
| files: ['**/*.ts', '**/*.test.ts'], | ||
| languageOptions: { | ||
| parser: tseslint.parser, | ||
| parserOptions: { | ||
| sourceType: 'module' | ||
| } | ||
| }, | ||
| name: 'zcli/monorepo', | ||
| rules: { | ||
| '@typescript-eslint/no-unused-expressions': ['error', { | ||
| allowShortCircuit: true, | ||
| allowTernary: true, | ||
| allowTaggedTemplates: true | ||
| }], | ||
| '@typescript-eslint/camelcase': 'off', | ||
| '@typescript-eslint/explicit-function-return-type': 'off', | ||
| '@typescript-eslint/no-unused-vars': [2, { argsIgnorePattern: '^_', varsIgnorePattern: '^_.+', caughtErrorsIgnorePattern: '^_.+' }], | ||
| 'eol-last': ['error', 'always'], | ||
| 'space-before-blocks': ['error', 'always'], | ||
| camelcase: 'off', | ||
| indent: ['error', 2], | ||
| semi: 'off' | ||
| } | ||
| }, | ||
| { | ||
| files: ['**/*.test.ts'], | ||
| languageOptions: { | ||
| globals: globals.mocha, | ||
| parser: tseslint.parser, | ||
| parserOptions: { | ||
| sourceType: 'module' | ||
| } | ||
| }, | ||
| name: 'zcli/tests' | ||
| }, | ||
| globalIgnores([ | ||
| 'node_modules', | ||
| 'packages/**/node_modules' | ||
| ]) | ||
|
Comment on lines
+76
to
+79
|
||
| ]) | ||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -49,7 +49,7 @@ export const getLocationIcons = (appPath: string, manifestLocations: Location = | |||
| }, {}) | ||||
| } | ||||
|
|
||||
| export const getInstallation = (appId: string, app: App, configFileContents: ZcliConfigFileContent, appSettings: Array<Record<string, any>>): Installation => { | ||||
| export const getInstallation = (appId: string, app: App, configFileContents: ZcliConfigFileContent, appSettings: Array<Record<string, unknown>>): Installation => { | ||||
| const installationId = configFileContents.installation_id || uuidV4() | ||||
|
|
||||
| return { | ||||
|
|
@@ -73,20 +73,21 @@ const mergeLocationAndIcons = (locations: Location, locationIcons: LocationIcons | |||
| for (const locationName in locationIcons[product]) { | ||||
| if (typeof (locations[product][locationName]) === 'string') { | ||||
| locations[product][locationName] = { | ||||
| url: locations[product][locationName] | ||||
| url: locations[product][locationName] as string | ||||
| } | ||||
| } | ||||
|
|
||||
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| export enum SecretType { | ||
| // eslint-disable-next-line no-unused-vars | ||
| TOKEN = 'token', PASSWORD = 'password' | ||
| PASSWORD = 'password', | ||
| TOKEN = 'token' | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'defineConfig' wrapper is unnecessary in ESLint v9 flat config. The configuration should be exported as a plain array. Replace 'defineConfig([...])' with just the array: 'export default [...]'.