-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
18,026 additions
and
11,161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
import eslint from '@eslint/js'; | ||
import tseslint from 'typescript-eslint'; | ||
import vue from 'eslint-plugin-vue'; | ||
import vueTs from '@vue/eslint-config-typescript'; | ||
import swESLintBase from '@shopware-ag/eslint-config-base'; | ||
import importPlugin from 'eslint-plugin-import' ; | ||
import stylistic from '@stylistic/eslint-plugin'; | ||
import globals from 'globals'; | ||
|
||
// use ADMIN_PATH environment variable to change from default installation | ||
process.env.ADMIN_PATH = | ||
process.env.ADMIN_PATH ?? | ||
(new URL('../../../../../../../src/Administration/Resources/app/administration', import.meta.url)).toString(); | ||
|
||
// const twigVuePlugin = import(`${process.env.ADMIN_PATH}/twigVuePlugin`); | ||
|
||
export default tseslint.config( | ||
eslint.configs.recommended, | ||
...vue.configs['flat/recommended'], | ||
...vueTs({ | ||
extends: [ | ||
'recommended', | ||
'recommendedTypeChecked', | ||
'eslintRecommended', | ||
], | ||
}), | ||
{ | ||
plugins: { import: importPlugin, stylistic }, | ||
|
||
ignores: [ | ||
'src/app/assets/icons/icons.js', | ||
'**/*.d.ts', | ||
], | ||
|
||
languageOptions: { | ||
ecmaVersion: 'latest', | ||
parserOptions: { | ||
projectService: true, | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
globals: { | ||
Shopware: true, | ||
}, | ||
}, | ||
|
||
settings: { | ||
'import/resolver': { | ||
node: {}, | ||
webpack: { | ||
config: { | ||
// Sync with webpack.config.js | ||
resolve: { | ||
extensions: ['.js', '.ts', '.vue', '.json', '.sass', '.twig'], | ||
alias: { | ||
SwagPayPal: (new URL('src', import.meta.url)).toString(), | ||
src: `${process.env.ADMIN_PATH}/src`, | ||
'@vue/test-utils': `${process.env.ADMIN_PATH}/node_modules/@vue/test-utils`, | ||
vue: `${process.env.ADMIN_PATH}/node_modules/@vue/compat/dist/vue.cjs.js`, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
||
rules: { | ||
...swESLintBase.rules, | ||
indent: 'off', | ||
'comma-dangle': 'off', | ||
'max-len': 'off', | ||
|
||
'no-console': ['error', { allow: ['warn', 'error'] }], | ||
'internal-rules/no-src-imports': 'off', | ||
|
||
/* import rules */ | ||
// lets depend on shopware's deps (vue and @vue/test-utils) | ||
'import/no-extraneous-dependencies': 'off', | ||
'import/no-useless-path-segments': 'off', | ||
'import/extensions': [ | ||
'error', | ||
'ignorePackages', | ||
{ js: 'never', ts: 'never' }, | ||
], | ||
/* import rules */ | ||
|
||
/* stylistic rules */ | ||
'stylistic/semi': ['error', 'always'], | ||
'stylistic/indent': ['error', 4, { SwitchCase: 1 }], | ||
'stylistic/member-delimiter-style': ['error'], | ||
'stylistic/no-multi-spaces': ['error'], | ||
'stylistic/object-curly-spacing': ['error', 'always'], | ||
'stylistic/space-before-function-paren': ['error', { | ||
anonymous: 'always', | ||
named: 'never', | ||
asyncArrow: 'always', | ||
}], | ||
'stylistic/spaced-comment': ['error', 'always'], | ||
'stylistic/no-tabs': ['error'], | ||
'stylistic/no-mixed-spaces-and-tabs': ['error'], | ||
'stylistic/max-len': 'off', | ||
'stylistic/quote-props': ['error', 'as-needed'], | ||
'stylistic/no-extra-semi': ['error'], | ||
'stylistic/comma-dangle': ['error', 'always-multiline'], | ||
/* stylistic rules */ | ||
|
||
/* typescript rules */ | ||
'@typescript-eslint/ban-ts-comment': ['error', { | ||
'ts-expect-error': false, | ||
}], | ||
'@typescript-eslint/no-unsafe-member-access': 'error', | ||
'@typescript-eslint/no-unsafe-call': 'error', | ||
'@typescript-eslint/no-unsafe-assignment': 'error', | ||
'@typescript-eslint/no-unsafe-return': 'error', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/prefer-ts-expect-error': 'error', | ||
'@typescript-eslint/no-floating-promises': 'off', | ||
'@typescript-eslint/no-shadow': 'error', | ||
'@typescript-eslint/consistent-type-imports': 'error', | ||
'@typescript-eslint/no-unused-vars': ['error', { | ||
argsIgnorePattern: '^_', | ||
varsIgnorePattern: '^_', | ||
caughtErrorsIgnorePattern: '^_|^(e|err)$', | ||
}], | ||
'@typescript-eslint/no-namespace': 'off', | ||
'@typescript-eslint/restrict-template-expressions': 'off', | ||
/* typescript rules */ | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.js'], | ||
|
||
ignores: ['src/app/assets/icons/icons.js'], | ||
|
||
extends: [tseslint.configs.disableTypeChecked], | ||
|
||
rules: { | ||
'prefer-promise-reject-errors': 'error', | ||
}, | ||
}, | ||
{ | ||
files: ['!src/**'], | ||
|
||
languageOptions: { | ||
globals: globals.node, | ||
}, | ||
}, | ||
); |
Oops, something went wrong.