eslint not enforcing rules in nested files

Viewed 45

I have a file structure like this:

-- project 
  -- server
    -- routes
      -- folder
        -- index.js (1)
        -- folder
           -- index.js (2)
  -- .eslintrc.js

eslint is able to enforce rules in index.js (1) but not in index.js(2) which is nested 1 level deeper. I have the eslint extension installed and working.

My eslint config:

module.exports = {
  env: {
    browser: true,
    es2021: true,
    jest: true,
  },
  extends: [
    'plugin:react/recommended',
    'airbnb',
  ],
  parserOptions: {
    ecmaFeatures: {
      jsx: true,
    },
    ecmaVersion: 'latest',
    sourceType: 'module',
  },
  plugins: [
    'react',
  ],
  rules: {
    semi: [2, 'never'],
    'max-len': 'off',
    'jsx-quotes': [2, 'prefer-single'],
    // 'jsx-wrap-multilines': 0,
    quotes: [2, 'single', 'avoid-escape'],
    'react/jsx-indent': [2, 2, { indentLogicalExpressions: true }],
    'no-underscore-dangle': 0,
    'react/jsx-props-no-spreading': 'off',
    'react/jsx-filename-extension': 'off',
    'react/no-unstable-nested-components': 'off',
    'react/prop-types': 'off',
    'no-nested-ternary': 'off',
  },
}

Could nesting be the issue preventing eslint from enforcing rules here?

Any info is appreciated!

0 Answers
Related