Sencha app.json CSS - sencha-cmd

CAn anyone explain the below app.json snippet regarding the CSS part.
app.json
"css": [
{
"path": "${build.out.css.path}",
"bundle": true
},
{
"path": "bootstrap.css",
"bootstrap": true
},
{
"path":"main.css"
}
],

Obviously, path is path to css file. If bundle set to true, it means that this file will become container for content from other css files in production mode. If bootstrap set to true, this file will be used only in development mode.
Here is example app.json file with detailed explanations: https://docs.sencha.com/cmd/guides/app_json.html

Related

like in VS Code highlighting never used exports?

I saw a colleague in webShtom highlighting of unused exports, how to enable this in VS Code?
The screenshot pretty much shows what you need: ESLint + TypeScript ESLint plugin + the no-unused-vars lint rule.
The minimal .eslintrc.json config file for this might look similar to this:
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:#typescript-eslint/recommended"
],
"parser": "#typescript-eslint/parser",
"parserOptions": {
},
"plugins": [
"#typescript-eslint"
],
"rules": {
"#typescript-eslint/no-unused-vars": ["warn"],
}
}
Note that TypeScript itself supports emitting warnings / errors for unused local variables via its noUnusedLocals tsconfig setting.

JS Doc is displaying description wierdly

Problem
I am busy writing out a tutorial for myself about jenkins and I am using jsdoc to do it.
anyways I noticed on the homepage that the section that reads the Readme.md is displaying very strangely.
jsdoc.json
{
"source": {
"include": ["src"],
"includePattern": ".+\\.js(doc|x)?$",
"excludePattern": "(node_modules/|docs)_"
},
"plugins": ["plugins/markdown"],
"tags": {
"allowUnknownTags": true,
"dictionaries": ["jsdoc","closure"]
},
"templates": {
"cleverLinks": true,
"monospaceLinks": true
},
"opts":{
"recurse": true,
"destination": "./docs/",
"tutorials": "./tutorials",
"readme": "README.md"
}
}
README.md
# LearningJenkins
## Tutorials
<!-- [Link to tutorials](https://codenameninja.github.io/LearningJenkins/) -->

Eslint allow multiple parsers based on glob patterns

My eslint parser as for now is #typescript-eslint/parser. I want to use #babel/plugin-proposal-optional-chaining plugin, which requires babel-eslint parser.
I saw the eslint-multiple-parsers but it says that it was deprecated :
Use ESLint configuration based on glob patterns (overrides). See https://eslint.org/docs/user-guide/configuring/#configuration-based-on-glob-patterns.
How can I set multiple parses that way?
From the Configuration Based on Glob Patterns
A glob specific configuration works almost the same as any other ESLint config. Override blocks can contain any configuration options that are valid in a regular config, with the exception of root and ignorePatterns.
In your eslint config file you can add an overrides section which is an array of objects. Each object is required to have files key where you define the glob pattern. Any file which match will then use the overriden config. Example:
{
// estree parser
"env": {
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:security/recommended"
],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"security"
],
"rules": {
"indent": [ "error", 4 ]
},
// rest of your "normal" configuration here
"overrides": [{
// for files matching this pattern
"files": ["*.ts"],
// following config will override "normal" config
"parser": "babel-eslint",
"parserOptions": {
// override parser options
},
"plugins": [
"#babel/plugin-proposal-optional-chaining"
],
"rules": [
// override rules
],
},
}]
}
However if you already use #typescript-eslint/parser then you probably already match *.ts files, and overriding would only make every *.ts file use babel-eslint instead, which doesn't solve your issue.
I assume you want both parsers (typescript-eslint and babel) to run against same file, but I don't know easy solution for that.
Is your goal to run parser A against files X and parser B against files Y?
#enterthenamehere-bohemian’s anwser is the solution.
Is your goal to run both parsers against the same files?
It depends…
Is your eslint running inside your editor?
As of today, I can see no solution inside a single eslint config file. You would need a single config file if you want to run it inside your editor.
Is your eslint running in your commandline or Continuous Integration environment?
You need three config files.
File .eslintrc.json
{
"parser": "#typescript-eslint/parser",
"extends": ["./eslint-common-rules.json"],
"rules": {
…typescript parser rules here
}
…
}
File .eslintrc.babel.json
{
"parser": "babel-eslint",
"extends": ["./eslint-common-rules.json"],
"rules": {
…babel parser rules here
}
…
}
File eslint-rules.json
{
"rules": { …
…common eslint rules here
}
…
}
Having that, you can run both in your comanndline:
eslint # <- runs .eslintrc.json
eslint --config .eslintrc.babel.json

vscode eslint not ignoring directory?

Despite clearly indicating in esignore that I want to ignore everything inside lib directory, vscode is saying 9 problems found in that minimized file.
If I run eslint inside foldera in command line everything is fine
using this extension
My directory structure:
foldera/
.eslintrc
.eslintignore
src/
file.js
lib/
wantoignore.min.js
folderb/
morefiles.js
.eslintrc
.eslintignore
.eslintrc file
{
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2017,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"no-console": "off"
}
}
.eslintignore
lib/*
workspace settings:
"eslint.workingDirectories": [
"./client", "./server"
]
I solved this problem following the official doc here.
Basically you need to add the following content to the vscode workspace settings (usually located in your project's root/.vscode/settings.json), so that vscode knows which configs to honor when you're working on a specific script file:
{
"eslint.workingDirectories": [ "./reactApp" ],
}
I had a similar problem, figured out need to set workingDirectory to nested folder:
module
lib
src
index.ts
.eslintrc.js
.eslintignore
VSCode setting should be:
"eslint.workingDirectories": [ "./module/lib" ]
And not
"eslint.workingDirectories": [ "./module" ]
My solutions is:
Source map
root/.vscode/settings.json
Script
{
"eslint.workingDirectories": [{ "mode": "auto" }],
}

Compiling Reason source files to the same directory as the source files

I'm writing a node application, where I would like to mix Reason and raw JavaScript.
This section in the bucklescript documentation describes it
When user has an existing JS project, it makes sense to output the JS
file in the same directory as vanilla JS, the schema added a key
called in-source so that generate JS file next to ML file.
I assume that this is in the bsconfig.json file? But what value should the key have? The schema documentation does not mention this option.
I'm running Bucklescript version 1.9.1 - so the functionality should be available (available since 1.9.0).
How do I use the in-source option?
My bsconfig.json file looks like this:
{
"name": "re-server",
"version": "0.1.0",
"bsc-flags": ["-bs-super-errors"],
"in-source": true, // I tried adding the key here
"sources": [{
"dir": "src",
"in-source": true // I tried adding the key here
}
],
"bs-dependencies" : [
"bs-express"
]
}
It should be in the "package-specs" section:
{
...
"package-specs" : [{
"module": ...,
"in-source": true
}]
}
So your bsconfig.json should look like:
{
"name": "re-server",
"version": "0.1.0",
"bsc-flags": ["-bs-super-errors"],
"package-specs" : [{
"module": "commonjs",
"in-source": true
}],
"sources": [{
"dir": "src"
}
],
"bs-dependencies" : [
"bs-express"
]
}