sveltejs / eslint-plugin-svelte3

An ESLint plugin for Svelte v3 components.
MIT License
373 stars 43 forks source link

Did not lint sub/subdirs #46

Closed rottmann closed 4 years ago

rottmann commented 4 years ago

Lint with eslint --debug src/**/*

[OK]         ./src/some.svelte
[OK]         ./src/components/some-component.svelte
[NOT LINTED] ./src/components/further-subdir/not-linted.svelte

If i put not-linted.svelte one dir up, it got linted.

ESLint Debug output

  eslint:file-enumerator Directory: /my-project/src/components/further-subdir +110ms
  eslint:ignored-paths contains: +109ms
  eslint:ignored-paths   target   = "/my-project/src/components/further-subdir/" +0ms
  eslint:ignored-paths   base     = "/my-project" +0ms
  eslint:ignored-paths   relative = "src/components/further-subdir/" +0ms
  eslint:ignored-paths   result   = false +0ms
  eslint:file-enumerator Enter the directory: /my-project/src/components/further-subdir +0ms
  eslint:cascading-config-array-factory Load config files for /my-project/src/components/further-subdir. +110ms
  eslint:cascading-config-array-factory No cache found: /my-project/src/components/further-subdir. +0ms
  eslint:config-array-factory Config file not found on /my-project/src/components/further-subdir +110ms
  eslint:cascading-config-array-factory Cache hit: /my-project/src/components. +0ms
  eslint:ignored-paths contains: +1ms
  eslint:ignored-paths   target   = "/my-project/src/components/further-subdir/not-linted.svelte" +0ms
  eslint:ignored-paths   base     = "/my-project" +0ms
  eslint:ignored-paths   relative = "src/components/further-subdir/not-linted.svelte" +0ms
  eslint:ignored-paths   result   = false +0ms
  eslint:file-enumerator Didn't match: not-linted.svelte +1ms

config

module.exports = {
  extends: [
    'standard'
  ],
  plugins: [
    'svelte3'
  ],
  env: {
    browser: true,
    es6: true,
    node: true
  },
  parserOptions: {
    ecmaVersion: 2019,
    sourceType: 'module'
  },
  overrides: [
    {
      files: [ '**/*.svelte' ],
      processor: 'svelte3/svelte3'
    }
  ],
  globals: {
    __DEV__ : false,
    __STAGE__: false,
    __TEST__: false,
    __PROD__: false,
    __COVERAGE__: false,
    Handlebars: true,
    UIkit: true
  },
  rules: {
    'array-bracket-spacing': 0,
    'computed-property-spacing': 0,
    'import/first': 0,
    'key-spacing': 0,
    'max-len': [2, 120, 2],
    'no-new': 0,
    'no-prototype-builtins': 0,
    'no-unneeded-ternary': 'off',
    'object-curly-spacing': [2, 'always'],
    'quotes': 0,
    'space-before-function-paren': 'off',
    'space-in-parens': 'off',
    'space-unary-ops': 'off',
    'strict': 2
  },
  settings: {
    'svelte3/ignore-styles': (attributes) => {
      return true
    }
  }
}

version

    "eslint": "^6.6.0",
    "eslint-config-standard": "^14.1.0",
    "eslint-plugin-import": "^2.18.2",
    "eslint-plugin-node": "^10.0.0",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-standard": "^4.0.1",
    "eslint-plugin-svelte3": "^2.7.3",
    "svelte": "^3.12.1",
Conduitry commented 4 years ago

This plugin is not responsible for making any of these sorts of decisions about whether a file is to be linted.

You're probably running into your shell's glob expansion. https://eslint.org/docs/user-guide/command-line-interface

rottmann commented 4 years ago

Thanks, i change it to eslint ./src --ext .js --ext .svelte.