This repo will be deleted next year.
expo / eslint-config-universe Goto Github PK
View Code? Open in Web Editor NEWMoved to https://github.com/expo/expo/tree/master/packages/eslint-config-universe
License: MIT License
Moved to https://github.com/expo/expo/tree/master/packages/eslint-config-universe
License: MIT License
This repo will be deleted next year.
According to Configuring ESLint I can do:
{
"rules": {
"eqeqeq": "off",
"curly": "error",
"quotes": ["error", "double"]
}
}
However, with the following configuration in my package.json
file, the rule is ignored:
"eslintConfig": {
"extends": "universe/native",
"rules": {
"quotes": ["error", "double"]
},
"settings": {
"react": {
"version": "detect"
}
}
},
"prettier": {
"trailingComma": "all"
}
When I change it to "quotes": "double"
, VS Code does not give me any warnings about double quotes however eslint complains that:
Configuration for rule "quotes" is invalid: Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '"double"').
And I don't get any errors when using single quotes.
There should be a section of the README explaining how you've changed the default Prettier rules and how to override them as I've demonstrated in #18
First of all, thank you for this project. The config is top notch and we can finally remove the eslint clutter we had.
My only issue is that when working with rookies, I would like to be able to enforce every rule as errors instead of warnings. Is there an easy way to do so without rewriting every rule?
after the following Installation steps, my current code looks
package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"expo": "^33.0.0",
"react": "16.8.3",
"react-dom": "^16.8.6",
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
"react-native-web": "^0.11.4"
},
"devDependencies": {
"babel-preset-expo": "^5.1.1",
"eslint": "^6.1.0",
"eslint-config-universe": "^1.0.7",
"prettier": "^1.18.2"
},
"private": true,
"eslintConfig": {
"extends": ["universe","universe/node", "universe/web","universe/native"]
}
}
.eslintrc.js
module.exports = {
extends: ["universe","universe/node", "universe/web","universe/native"],
};
so I'm getting error
Failed to compile.
/usr/local/lib/node_modules/expo-cli/node_modules/react-error-overlay/lib/index.js
Line 1: 'define' is not defined no-undef
Line 1: 'define' is not defined no-undef
Line 1: 'regeneratorRuntime' is not defined no-undef
Line 1: 'h' is a function no-func-assign
Line 1: 'm' is a function no-func-assign
Line 1: 'R' is a function no-func-assign
Line 1: 'q' is a function no-func-assign
Line 1: 'W' is a function no-func-assign
Search for the keywords to learn more about each error.
Plugin requires that typescript is installed even if you arent using typescript, is there a way to decouple this?
"extends": "expo/react" throws config error
while "extends": "expo" is working perfectly with exception of being unusable with React's JSX (which defies the purpose of a whole config?)
I'm using Atom editor (by the way, it threw an "eslint-plugin-flowtype" error, so I installed it (you probably should mention it in the readme)
I hadd to add "import/no-unresolved": 2
to my config rules to make sure I get an error when I'm importing something that can't be resolved path wise.
Do you guys think this would be a useful rule to have as default in this config?
Recently switched project from airbnb config to universe due to cleaner implementation and universal approach for cross platform apps.
One feature I am missing right now is errors for props being used without correlating prop type validation, is there an option to enable this without extending into another eslint packages?
EsLint is giving me no-unused-vars for things that I am using in the JSX
I have initialized a node project. I saw eslint-config-universe and thought of using it for my node lint config.
I have installed the required dependencies:
"devDependencies": {
"eslint-config-universe": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^2.3.1",
"@typescript-eslint/parser": "^2.3.1",
"eslint": "^6.4.0",
"prettier": "^1.18.2",
"typescript": "^3.6.3"
}
and I made the following .eslintrc.js file:
module.exports = {
extends: "universe/node"
};
The following from ESLint message got me confused. Why is it trying to detect react version when I specified universe/node?
Possibly remove './shared/react.js'
from
eslint-config-universe/node.js
Line 2 in 6cdd359
Example .prettierrc
printWidth: 100
tabWidth: 2
singleQuote: true
jsxBracketSameLine: true
trailingComma: 'es5'
It's in YAML
format, which is correct according to the documentation.
But if I use it, I get this error:
SyntaxError: Cannot read config file: [redacted]/node_modules/eslint-config-universe/shared/prettier.js
Error: Unexpected token a in JSON at position 1
Referenced from: [redacted]/node_modules/eslint-config-universe/default.js
Referenced from: [redacted]t/.eslintrc.js
at JSON.parse (<anonymous>)
at readPrettierConfig ([redacted]/node_modules/eslint-config-universe/shared/readPrettierConfig.js:21:19)
at Object.<anonymous> ([redacted]/node_modules/eslint-config-universe/shared/prettier.js:15:35)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
Hello !
I have a problem when I'm trying to write es7 decorators.
I have this error with this command ./node_modules/.bin/eslint pages/login.js
:
Cannot read property 'type' of undefined
TypeError: Cannot read property 'type' of undefined
at isForInRef (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/rules/no-unused-vars.js:410:24)
at variable.references.some.ref (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/rules/no-unused-vars.js:447:21)
at Array.some (<anonymous>)
at isUsedVariable (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/rules/no-unused-vars.js:446:40)
at collectUnusedVariables (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/rules/no-unused-vars.js:569:26)
at collectUnusedVariables (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/rules/no-unused-vars.js:576:17)
at Program:exit (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/rules/no-unused-vars.js:621:36)
at listeners.(anonymous function).forEach.listener (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/util/safe-emitter.js:47:58)
at Array.forEach (<anonymous>)
at Object.emit (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/util/safe-emitter.js:47:38)
at NodeEventGenerator.applySelector (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/util/node-event-generator.js:251:26)
at NodeEventGenerator.applySelectors (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/util/node-event-generator.js:280:22)
at NodeEventGenerator.leaveNode (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/util/node-event-generator.js:303:14)
at CodePathAnalyzer.leaveNode (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:630:23)
at Traverser.leave [as _leave] (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/linter.js:1000:32)
at Traverser._traverse (/Users/guillaumemartinez/GitHub/sodexo-web/node_modules/eslint/lib/util/traverser.js:155:18)
Content of pages/login.js
:
@App
export default class Login extends React.PureComponent {
render() {
return <div />
}
}
Updating babel-eslint
to ^8.1.2
solve the problem
https://www.npmjs.com/search?q=eslint-config-expo
Is it eslint-config-universe
or eslint-config-expo
? The installation instructions say eslint-config-expo
.
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.