.eslintrc.minimal.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. /**
  20. * MINIMAL ESLint config - ONLY for rules OXC doesn't support
  21. * This config is designed to be run alongside OXC linter
  22. *
  23. * Only covers:
  24. * - Custom Superset plugins (theme-colors, icons, i18n)
  25. * - Prettier formatting
  26. * - File progress indicator
  27. */
  28. module.exports = {
  29. root: true,
  30. // Don't report on eslint-disable comments for rules we don't have
  31. reportUnusedDisableDirectives: false,
  32. // Simple parser - no TypeScript needed since OXC handles that
  33. parser: '@babel/eslint-parser',
  34. parserOptions: {
  35. ecmaVersion: 2020,
  36. sourceType: 'module',
  37. ecmaFeatures: {
  38. jsx: true,
  39. },
  40. requireConfigFile: false,
  41. babelOptions: {
  42. presets: ['@babel/preset-react', '@babel/preset-env'],
  43. },
  44. },
  45. env: {
  46. browser: true,
  47. node: true,
  48. es2020: true,
  49. },
  50. plugins: [
  51. // ONLY custom Superset plugins that OXC doesn't support
  52. 'theme-colors',
  53. 'icons',
  54. 'i18n-strings',
  55. 'file-progress',
  56. 'prettier',
  57. ],
  58. rules: {
  59. // === ONLY rules that OXC cannot handle ===
  60. // Prettier integration (formatting)
  61. 'prettier/prettier': 'error',
  62. // Custom Superset plugins
  63. 'theme-colors/no-literal-colors': 'error',
  64. 'icons/no-fa-icons-usage': 'error',
  65. 'i18n-strings/no-template-vars': ['error', true],
  66. 'file-progress/activate': 1,
  67. // Explicitly turn off all other rules to avoid conflicts
  68. // when the config gets merged with other configs
  69. 'import/no-unresolved': 'off',
  70. 'import/extensions': 'off',
  71. '@typescript-eslint/naming-convention': 'off',
  72. },
  73. overrides: [
  74. {
  75. // Disable custom rules in test/story files
  76. files: [
  77. '**/*.test.*',
  78. '**/*.spec.*',
  79. '**/*.stories.*',
  80. '**/test/**',
  81. '**/tests/**',
  82. '**/spec/**',
  83. '**/__tests__/**',
  84. '**/__mocks__/**',
  85. 'cypress-base/**',
  86. 'packages/superset-ui-core/src/theme/index.tsx',
  87. ],
  88. rules: {
  89. 'theme-colors/no-literal-colors': 0,
  90. 'icons/no-fa-icons-usage': 0,
  91. 'i18n-strings/no-template-vars': 0,
  92. 'file-progress/activate': 0,
  93. },
  94. },
  95. ],
  96. // Only check src/ files where theme/icon rules matter
  97. ignorePatterns: [
  98. 'node_modules',
  99. 'dist',
  100. 'build',
  101. '.next',
  102. 'coverage',
  103. '*.min.js',
  104. 'vendor',
  105. // Skip packages/plugins since they have different theming rules
  106. 'packages/**',
  107. 'plugins/**',
  108. // Skip generated/external files
  109. '*.generated.*',
  110. '*.config.js',
  111. 'webpack.*',
  112. // Temporary analysis files
  113. '*.js', // Skip all standalone JS files in root
  114. '*.json',
  115. ],
  116. };