snanovskyi / eslint-to-editorconfig Goto Github PK
View Code? Open in Web Editor NEWModule for transforming configuration from ESLint to EditorConfig format
License: ISC License
Module for transforming configuration from ESLint to EditorConfig format
License: ISC License
Running eslint-to-editorconfig
outputs "ESLint configuration is invalid" without any additional information. However it is not invalid, as ESLint works fine, both CLI and IDE.
eslint-to-editorconfig version: 2.0.0
eslint version: 7.3.1
.eslintrc.js file:
module.exports = {
"env": {
"browser": true,
"es2017": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.eslint.json",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"import",
"prefer-arrow"
],
"rules": {
// bunch of rules
},
"overrides": [
{
"files": ["*.spec.ts"],
"env": {
"jasmine": true
},
"rules": {
// bunch of rule overrides
}
}
]
};
I've run into errors like the following, and they appear to be due to using an outdated version of eslint
/path/to/project/node_modules/eslint-to-editorconfig/node_modules/eslint/lib/config/config-file.js:402
throw e;
^
Error: /path/to/project/node_modules/eslint-config-airbnb-base/rules/es6.js:
Configuration for rule "arrow-parens" is invalid:
Value "as-needed,[object Object]" has more items than allowed.
Referenced from: airbnb-base
Referenced from: /path/to/project/.eslintrc
Hi,
I'v tried running this against airbnb's config and got the following error:
/usr/local/lib/node_modules/eslint-to-editorconfig/node_modules/eslint/lib/config/config-file.js:332
throw e;
^
Error: /usr/local/lib/node_modules/eslint-config-airbnb/rules/best-practices.js:
Configuration for rule "no-labels" is invalid:
Value "2,[object Object]" has more items than allowed.
Any ideas?
/Stephen.
Hi, this looks very useful.
Have you considered using getConfigForFiles()
instead of pulling the rule configuration straight from an .eslintrc
? This would have the benefit of detecting rules extended from a sharable config like standard.
As the title states, are there any plans on supporting editorconfig to eslint conversion?
When I am running the command It is thowing following error. I have .eslintrc
in my current directory
~/.npm-packages/lib/node_modules/eslint-to-editorconfig/index.js:43
if (rules['max-len'][0] > 0) {
^
TypeError: Cannot read property '0' of undefined
at maxLineLength (~/.npm-packages/lib/node_modules/eslint-to-editorconfig/index.js:43:23)
at rulesToProps (~/.npm-packages/lib/node_modules/eslint-to-editorconfig/index.js:72:3)
at module.exports (~/.npm-packages/lib/node_modules/eslint-to-editorconfig/index.js:96:5)
at Object.<anonymous> (~/.npm-packages/lib/node_modules/eslint-to-editorconfig/bin.js:5:1)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.