forked from Leaflet/Leaflet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to ESLint 9+ and flat config (Leaflet#9410)
- Loading branch information
Showing
16 changed files
with
1,759 additions
and
1,865 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* global hljs */ | ||
/* global hljs, L */ | ||
hljs.configure({tabReplace: ' '}); | ||
hljs.initHighlighting(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ title: WMS example | |
layers: 'TOPO-OSM-WMS' | ||
}).addTo(map); | ||
|
||
</script> | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import config from 'eslint-config-mourner'; | ||
import scriptTags from '@mapbox/eslint-plugin-script-tags'; | ||
import importPlugin from 'eslint-plugin-import-x'; | ||
import globals from 'globals'; | ||
|
||
export default [ | ||
...config, | ||
{ | ||
files: ['*.js', '*.mjs', '*.cjs'], | ||
}, | ||
{ | ||
ignores: [ | ||
'dist', | ||
'docs/docs/highlight', | ||
'docs/examples/choropleth/us-states.js', | ||
'docs/examples/geojson/sample-geojson.js', | ||
'docs/examples/map-panes/eu-countries.js', | ||
'docs/examples/extending/extending-2-layers.md', | ||
'docs/_posts/201*', | ||
'docs/_site', | ||
'coverage' | ||
] | ||
}, | ||
{ | ||
plugins: { | ||
import: importPlugin | ||
}, | ||
rules: { | ||
'dot-notation': 'off', | ||
'consistent-return': 'off', | ||
'curly': 'error', | ||
'no-unused-expressions': ['error', {allowShortCircuit: true}], | ||
'no-unused-vars': ['error', {caughtErrors: 'none'}], | ||
|
||
'import/extensions': ['error', 'ignorePackages'], | ||
|
||
'@stylistic/js/indent': ['error', 'tab', {VariableDeclarator: 0, flatTernaryExpressions: true}], | ||
'@stylistic/js/no-mixed-spaces-and-tabs': ['error', 'smart-tabs'], | ||
'@stylistic/js/key-spacing': 'off', | ||
'@stylistic/js/linebreak-style': ['off', 'unix'], | ||
'@stylistic/js/spaced-comment': 'error', | ||
|
||
// TODO: Re-enable the rules below and fix the linting issues. | ||
'no-invalid-this': 'off', | ||
'prefer-object-has-own': 'error', | ||
'prefer-spread': 'off', | ||
'no-new': 'off' | ||
} | ||
}, | ||
{ | ||
files: ['spec/**'], | ||
languageOptions: { | ||
globals: {...globals.mocha} | ||
}, | ||
rules: { | ||
'no-unused-expressions': 'off' | ||
} | ||
}, | ||
{ | ||
files: ['build/**'], | ||
languageOptions: { | ||
parserOptions: { | ||
ecmaVersion: 2022 | ||
} | ||
} | ||
}, | ||
{ | ||
files: ['docs/**/*.md'], | ||
plugins: { | ||
scriptTags: { | ||
processors: {md: scriptTags.processors['.md']} | ||
} | ||
}, | ||
processor: 'scriptTags/md', | ||
rules: { | ||
'no-unused-vars': 'off', | ||
'@stylistic/js/eol-last': 'off' | ||
}, | ||
languageOptions: { | ||
globals: {L: false} | ||
} | ||
} | ||
]; |
Oops, something went wrong.