
This includes JS linting support for the `js` code blocks in our Markdown files. Note that some of those code blocks use C-style syntax to document input and output types (e.g. `Pattern pattern.on(string hook, function method)`), which means those code blocks will start producing lint errors when those Markdown files are touched (those lint errors also happen to be rather obtuse, e.g. `Parsing error: Missing semicolon.`). One solution might be to install [`typescript-eslint`](https://typescript-eslint.io/) and convert the offending code blocks into syntactically valid TypeScript, as long as that doesn't confuse new developers into trying to put TypeScript in their FreeSewing files.
37 lines
854 B
YAML
37 lines
854 B
YAML
env:
|
|
browser: true
|
|
es2021: true
|
|
extends: eslint:recommended
|
|
# Required when using experimental EcmaScript features
|
|
parser: "@babel/eslint-parser"
|
|
parserOptions:
|
|
ecmaVersion: latest
|
|
sourceType: module
|
|
# Options specific to the Babel parser
|
|
requireConfigFile: false
|
|
babelOptions:
|
|
plugins:
|
|
- "@babel/plugin-syntax-import-assertions"
|
|
rules: {}
|
|
overrides:
|
|
# YAML files
|
|
- files: ["**/*.yaml", "**/*.yml"]
|
|
plugins: ["yaml"]
|
|
extends: ["plugin:yaml/recommended"]
|
|
# Markdown files
|
|
- files: ["**/*.md"]
|
|
plugins: ["markdown"]
|
|
processor: "markdown/markdown"
|
|
- files: ["**/*.md/*.js"]
|
|
rules:
|
|
"no-console": "off"
|
|
"no-empty": "off"
|
|
"no-undef": "off"
|
|
"no-unused-labels": "off"
|
|
"no-unused-vars": "off"
|
|
globals:
|
|
it: readonly
|
|
describe: readonly
|
|
process: readonly
|
|
__dirname: readonly
|
|
|