GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — contentstack-spartacus-connector/eslint.config.mjs at main · contentstack/contentstack-spartacus-connector Expand file tree/ Copy patheslint.config.mjsMore file actions 98 lines (97 loc) · 3.38 KB / Copy patheslint.config.mjsFile metadata and controls98 lines (97 loc) · 3.38 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 // @ts-check // Flat ESLint config for the Contentstack Spartacus connector. // // Type-UNAWARE linting on purpose: we do NOT set `parserOptions.project`, so // ESLint never has to resolve @spartacus/* (registry-gapped — see .npmrc / // tsconfig.typecheck.json). Type correctness is covered separately by // `npm run typecheck`; this config catches lint-level issues only. import eslint from '@eslint/js'; import tseslint from 'typescript-eslint'; import angular from 'angular-eslint'; import prettier from 'eslint-config-prettier'; export default tseslint.config( { // Not source we own / not lintable as library TS. ignores: [ 'dist/**', 'node_modules/**', 'coverage/**', 'typings/**', 'scripts/**', 'import-export/**', 'schematics/**/*.js', 'schematics/**/*.js.map', '**/*.cjs', '**/*.mjs', ], }, { files: ['**/*.ts'], extends: [ eslint.configs.recommended, ...tseslint.configs.recommended, ...tseslint.configs.stylistic, ...angular.configs.tsRecommended, // Must stay LAST: turns off rules that conflict with Prettier formatting. prettier, ], processor: angular.processInlineTemplates, rules: { // Library uses the `cs` selector prefix (cs-custom-hero, [csEditable], // [csEmptyBlockParent]). '@angular-eslint/directive-selector': [ 'error', { type: 'attribute', prefix: 'cs', style: 'camelCase' }, ], '@angular-eslint/component-selector': [ 'error', { type: 'element', prefix: 'cs', style: 'kebab-case' }, ], // The connector maps loosely-typed Delivery-API JSON (index signatures, // unresolved references), so `any` is sometimes unavoidable at the SDK // boundary. Surface it as a warning rather than blocking the build. '@typescript-eslint/no-explicit-any': 'warn', '@typescript-eslint/no-unused-vars': [ 'error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', // `const { a, b, ...rest } = x` destructure-to-omit is intentional // (see contentstack-field-mapper stripAuthoringKeys). ignoreRestSiblings: true, }, ], // `interface Config extends ContentstackConfig {}` is the Spartacus // ambient module-augmentation idiom, not a redundant empty interface. '@typescript-eslint/no-empty-object-type': [ 'error', { allowInterfaces: 'with-single-extends' }, ], // Existing code uses constructor injection. Migrating to inject() is a // deliberate, separate refactor — surface it, don't block on it. '@angular-eslint/prefer-inject': 'warn', }, }, { files: ['**/*.spec.ts', 'test/**/*.ts'], rules: { // Test doubles / stubs legitimately use `any`, non-null assertions, // empty function bodies, and throwaway generic params. '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-unused-vars': 'off', }, }, { files: ['**/*.html'], extends: [ ...angular.configs.templateRecommended, ...angular.configs.templateAccessibility, ], rules: { // @if/@for migration in the example template is a separate task. '@angular-eslint/template/prefer-control-flow': 'warn', }, }, ); |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |