Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.0.3 unable to load .eslintrc.js file #35

Closed
roypearce opened this issue Dec 28, 2020 · 2 comments
Closed

5.0.3 unable to load .eslintrc.js file #35

roypearce opened this issue Dec 28, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@roypearce
Copy link

Describe the bug
First, thanks for your work on this project.

Version 5.0.2 is able to load the projects .eslintrc.js file just fine and applies the import sort order as expected. Starting with 5.0.3 the log files say they are unable to load the same file (though the location is accurate, and the file can be opened by clicking the path the logs say it is unable to open).

Specific error: [2020-12-28T18:14:39.380] [WARN] config.loadESLintConfig - Failed loading ESLint config: Cannot read config file: /Users/myuser/code/my-project/.eslintrc.js

Here is the log output from opening VSCode to saving a file:

[2020-12-28T18:14:16.552] [INFO] default - os: {
  arch: 'x64',
  platform: 'darwin',
  type: 'Darwin',
  release: '19.6.0',
  totalmem: 17179869184,
  freemem: 1896468480,
  EOL: '\n'
}
[2020-12-28T18:14:16.553] [INFO] default - vscode: { version: '1.52.1' }
[2020-12-28T18:14:16.554] [INFO] default - extensions: {
  builtIn: [
    'Windows Bat Language Basics (vscode.bat@1.0.0)',
    'Clojure Language Basics (vscode.clojure@1.0.0)',
    'CoffeeScript Language Basics (vscode.coffeescript@1.0.0)',
    'Configuration Editing (vscode.configuration-editing@1.0.0)',
    'C/C++ Language Basics (vscode.cpp@1.0.0)',
    'C# Language Basics (vscode.csharp@1.0.0)',
    'CSS Language Basics (vscode.css@1.0.0)',
    'CSS Language Features (vscode.css-language-features@1.0.0)',
    'Node Debug Auto-attach (vscode.debug-auto-launch@1.0.0)',
    'Server Ready Action (vscode.debug-server-ready@1.0.0)',
    'Docker Language Basics (vscode.docker@1.0.0)',
    'Emmet (vscode.emmet@1.0.0)',
    'Extension Authoring (vscode.extension-editing@1.0.0)',
    'F# Language Basics (vscode.fsharp@1.0.0)',
    'Git (vscode.git@1.0.0)',
    'Git UI (vscode.git-ui@1.0.0)',
    'GitHub (vscode.github@0.0.1)',
    'GitHub Authentication (vscode.github-authentication@0.0.1)',
    'Go Language Basics (vscode.go@1.0.0)',
    'Groovy Language Basics (vscode.groovy@1.0.0)',
    'Grunt support for VS Code (vscode.grunt@1.0.0)',
    'Gulp support for VSCode (vscode.gulp@1.0.0)',
    'Handlebars Language Basics (vscode.handlebars@1.0.0)',
    'HLSL Language Basics (vscode.hlsl@1.0.0)',
    'HTML Language Basics (vscode.html@1.0.0)',
    'HTML Language Features (vscode.html-language-features@1.0.0)',
    'Image Preview (vscode.image-preview@1.0.0)',
    'Ini Language Basics (vscode.ini@1.0.0)',
    'Jake support for VS Code (vscode.jake@1.0.0)',
    'Java Language Basics (vscode.java@1.0.0)',
    'JavaScript Language Basics (vscode.javascript@1.0.0)',
    'JSON Language Basics (vscode.json@1.0.0)',
    'JSON Language Features (vscode.json-language-features@1.0.0)',
    'Less Language Basics (vscode.less@1.0.0)',
    'Log (vscode.log@1.0.0)',
    'Lua Language Basics (vscode.lua@1.0.0)',
    'Make Language Basics (vscode.make@1.0.0)',
    'Markdown Language Basics (vscode.markdown@1.0.0)',
    'Markdown Language Features (vscode.markdown-language-features@1.0.0)',
    'Merge Conflict (vscode.merge-conflict@1.0.0)',
    'Microsoft Account (vscode.microsoft-authentication@0.0.1)',
    'JavaScript Debugger Companion Extension (ms-vscode.js-debug-companion@1.0.8)',
    'Node Debug (legacy) (ms-vscode.node-debug@1.44.15)',
    'Node Debug (ms-vscode.node-debug2@1.42.5)',
    'Reference Search View (ms-vscode.references-view@0.0.74)',
    'ms-vscode.vscode-js-profile-table@0.0.11',
    'NPM support for VS Code (vscode.npm@1.0.1)',
    'Objective-C Language Basics (vscode.objective-c@1.0.0)',
    'Perl Language Basics (vscode.perl@1.0.0)',
    'PHP Language Basics (vscode.php@1.0.0)',
    'PHP Language Features (vscode.php-language-features@1.0.0)',
    'Powershell Language Basics (vscode.powershell@1.0.0)',
    'Pug Language Basics (vscode.pug@1.0.0)',
    'Python Language Basics (vscode.python@1.0.0)',
    'R Language Basics (vscode.r@1.0.0)',
    'Razor Language Basics (vscode.razor@1.0.0)',
    'Ruby Language Basics (vscode.ruby@1.0.0)',
    'Rust Language Basics (vscode.rust@1.0.0)',
    'SCSS Language Basics (vscode.scss@1.0.0)',
    'Search Result (vscode.search-result@1.0.0)',
    'Shaderlab Language Basics (vscode.shaderlab@1.0.0)',
    'Shell Script Language Basics (vscode.shellscript@1.0.0)',
    'SQL Language Basics (vscode.sql@1.0.0)',
    'Swift Language Basics (vscode.swift@1.0.0)',
    'Abyss Theme (vscode.theme-abyss@1.0.0)',
    'Default Themes (vscode.theme-defaults@1.0.0)',
    'Kimbie Dark Theme (vscode.theme-kimbie-dark@1.0.0)',
    'Monokai Theme (vscode.theme-monokai@1.0.0)',
    'Monokai Dimmed Theme (vscode.theme-monokai-dimmed@1.0.0)',
    'Quiet Light Theme (vscode.theme-quietlight@1.0.0)',
    'Red Theme (vscode.theme-red@1.0.0)',
    'Seti File Icon Theme (vscode.vscode-theme-seti@1.0.0)',
    'Solarized Dark Theme (vscode.theme-solarized-dark@1.0.0)',
    'Solarized Light Theme (vscode.theme-solarized-light@1.0.0)',
    'Tomorrow Night Blue Theme (vscode.theme-tomorrow-night-blue@1.0.0)',
    'TypeScript Language Basics (vscode.typescript@1.0.0)',
    'TypeScript and JavaScript Language Features (vscode.typescript-language-features@1.0.0)',
    'Visual Basic Language Basics (vscode.vb@1.0.0)',
    'XML Language Basics (vscode.xml@1.0.0)',
    'YAML Language Basics (vscode.yaml@1.0.0)'
  ],
  installed: [
    'ESLint (dbaeumer.vscode-eslint@2.1.14)',
    'JS/TS Import/Export Sorter (dozerg.tsimportsorter@5.0.3)',
    'HTML CSS Support (ecmel.vscode-html-css@1.5.0)',
    'Prettier - Code formatter (esbenp.prettier-vscode@5.8.0)',
    'Prettify JSON (mohsen1.prettify-json@0.0.3)',
    'MDX (silvenon.mdx@0.1.0)',
    'stylelint (stylelint.vscode-stylelint@0.85.0)',
    'Sort JS object keys (zengxingxin.sort-js-object-keys@1.0.6)'
  ]
}
[2020-12-28T18:14:39.350] [INFO] vscode.resolveConfig - Start resolving configs for fileName: /Users/myuser/code/my-project/src/app-dashboard/components/header/dashboard-header.tsx, languageId: typescriptreact
[2020-12-28T18:14:39.352] [DEBUG] config.loadVscConfig - Finish loading VSC config
[2020-12-28T18:14:39.352] [DEBUG] config.loadImportSorterConfig - Load Prettier/EditorConfig config.
[2020-12-28T18:14:39.352] [INFO] config.loadPretConfig - Prettier API version:  2.2.1
[2020-12-28T18:14:39.363] [DEBUG] config.loadImportSorterConfig - Load import-sorter config from import-sorter.json
[2020-12-28T18:14:39.364] [DEBUG] config.loadImportSorterConfig - Load package.json config.
[2020-12-28T18:14:39.364] [DEBUG] config.loadESLintConfig - Start loading ESLint config for filePath: /Users/myuser/code/my-project/src/app-dashboard/components/header/dashboard-header.tsx
[2020-12-28T18:14:39.364] [INFO] config.loadESLintConfig - ESLint API version: 7.16.0
[2020-12-28T18:14:39.380] [WARN] config.loadESLintConfig - Failed loading ESLint config: Cannot read config file: /Users/myuser/code/my-project/.eslintrc.js
Error: Cannot find module '/Users/myuser/code/my-project/.eslintrc.js'
[2020-12-28T18:14:39.381] [DEBUG] config.loadTsConfig - Find TS config for fileName: /Users/myuser/code/my-project/src/app-dashboard/components/header/dashboard-header.tsx
[2020-12-28T18:14:39.381] [DEBUG] config.loadTsConfig - Load TS config for fileName: /Users/myuser/code/my-project/src/app-dashboard/components/header/dashboard-header.tsx
[2020-12-28T18:14:39.388] [DEBUG] config.loadTsConfig - Parse TS config for path: /Users/myuser/code/my-project
[2020-12-28T18:14:39.407] [DEBUG] vscode.resolveConfig - Finish resolving configs.
[2020-12-28T18:14:39.407] [DEBUG] formatDocument - Start formatting fileName: /Users/myuser/code/my-project/src/app-dashboard/components/header/dashboard-header.tsx
[2020-12-28T18:14:39.408] [INFO] parser.formatSource - config: {
  configurationFileName: 'import-sorter.json',
  autoFormat: 'onSave',
  formatExports: true,
  exclude: [ 'node_modules' ],
  excludeGlob: [],
  sortImportsBy: 'paths',
  groupRules: [ '^react(-dom)?$', '^@angular/', '^vue$', {}, '^[@]', '^[.]' ],
  sortRules: { paths: [ '_', 'aA' ], names: [ '_', 'aA' ] },
  keepUnused: [],
  emptyLinesBetweenGroups: 1,
  emptyLinesAfterAllImports: 1,
  removeLastSlashInPath: false,
  removeLastIndexInPath: false,
  maxBindingNamesPerLine: 1,
  maxDefaultAndBindingNamesPerLine: 2,
  maxExportNamesPerLine: 0,
  maxNamesPerWrappedLine: 1,
  development: { enableDebug: true },
  insertFinalNewline: true,
  maxLineLength: 100,
  tabType: 'space',
  tabSize: 2,
  hasSemicolon: true,
  quoteMark: 'single',
  trailingComma: 'multiLine',
  bracketSpacing: true,
  eol: 'LF'
}
[2020-12-28T18:14:39.408] [INFO] parser.formatSource - eslintConfig: undefined
[2020-12-28T18:14:39.408] [INFO] parser.formatSource - tsCompilerOptions: {
  allowJs: false,
  allowSyntheticDefaultImports: true,
  allowUnreachableCode: false,
  baseUrl: '/Users/myuser/code/my-project/src',
  experimentalDecorators: true,
  jsx: 1,
  lib: [ 'lib.es2020.d.ts', 'lib.dom.d.ts' ],
  module: 6,
  moduleResolution: 2,
  noImplicitAny: false,
  noUnusedLocals: true,
  noUnusedParameters: true,
  paths: { '@root/*': [ '../*' ], '@src/*': [ './*' ] },
  resolveJsonModule: true,
  skipLibCheck: true,
  sourceMap: true,
  strictBindCallApply: true,
  strictNullChecks: false,
  target: 7,
  pathsBasePath: '/Users/myuser/code/my-project',
  configFilePath: undefined
}
[2020-12-28T18:14:39.408] [DEBUG] parser.formatSource - Translated ESLint config to newConfig: {
  configurationFileName: 'import-sorter.json',
  autoFormat: 'onSave',
  formatExports: true,
  exclude: [ 'node_modules' ],
  excludeGlob: [],
  sortImportsBy: 'paths',
  groupRules: [ '^react(-dom)?$', '^@angular/', '^vue$', {}, '^[@]', '^[.]' ],
  sortRules: { paths: [ '_', 'aA' ], names: [ '_', 'aA' ] },
  keepUnused: [],
  emptyLinesBetweenGroups: 1,
  emptyLinesAfterAllImports: 1,
  removeLastSlashInPath: false,
  removeLastIndexInPath: false,
  maxBindingNamesPerLine: 1,
  maxDefaultAndBindingNamesPerLine: 2,
  maxExportNamesPerLine: 0,
  maxNamesPerWrappedLine: 1,
  development: { enableDebug: true },
  insertFinalNewline: true,
  maxLineLength: 100,
  tabType: 'space',
  tabSize: 2,
  hasSemicolon: true,
  quoteMark: 'single',
  trailingComma: 'multiLine',
  bracketSpacing: true,
  eol: 'LF'
}
[2020-12-28T18:14:39.408] [DEBUG] parser.formatSource - ESLint config processed data: undefined
[2020-12-28T18:14:39.422] [DEBUG] parser.formatSource - composeConfig: {
  maxLength: 100,
  maxWords: {
    withoutDefault: 1,
    withDefault: 2,
    wrapped: 1,
    exported: 9007199254740991
  },
  groupSep: '\n\n',
  groupEnd: 2,
  tab: '  ',
  quote: [Function],
  comma: ',',
  semi: ';',
  bracket: [Function],
  lastNewLine: true,
  nl: '\n'
}
[2020-12-28T18:14:39.486] [INFO] formatDocument - Finished format.

@daidodo
Copy link
Owner

daidodo commented Dec 29, 2020

Hi @roypearce, thanks for reporting the issue!

The issue is related to Webpack so I disabled it and released a new version 5.0.6.

Please try it out and tell me if the problem persists.

@roypearce
Copy link
Author

Yes, that seems to have fixed it, thank you!

daidodo pushed a commit that referenced this issue Dec 29, 2020
@daidodo daidodo added the bug Something isn't working label Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants