Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 197 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
const js = require('@eslint/js');

module.exports = [
{
ignores: ['node_modules/**', 'eslint.config.js'],
},
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2019,
sourceType: 'module',
globals: {
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
exports: 'writable',
global: 'readonly',
module: 'writable',
require: 'readonly',
fetch: 'readonly',
},
},
rules: {
...js.configs.recommended.rules,
'accessor-pairs': 'error',
'array-bracket-spacing': 'off',
'array-callback-return': 'error',
'arrow-body-style': 'error',
'arrow-parens': 'error',
'arrow-spacing': 'error',
'block-scoped-var': 'error',
'block-spacing': ['error', 'always'],
'brace-style': ['error', '1tbs', {allowSingleLine: true}],
'callback-return': 'error',
camelcase: 'error',
'class-methods-use-this': 'error',
'comma-dangle': 'error',
'comma-spacing': ['error', {after: true, before: false}],
'comma-style': 'error',
complexity: 'off',
'computed-property-spacing': ['error', 'never'],
'consistent-return': 'error',
'consistent-this': 'error',
curly: 'off',
'default-case': 'error',
'dot-location': ['error', 'property'],
'dot-notation': 'error',
'eol-last': 'error',
eqeqeq: 'error',
'func-call-spacing': 'error',
'func-names': ['error', 'never'],
'generator-star-spacing': 'error',
'guard-for-in': 'error',
'handle-callback-err': 'error',
'id-blacklist': 'error',
'id-match': 'error',
indent: 'error',
'init-declarations': 'off',
'jsx-quotes': 'error',
'key-spacing': 'error',
'keyword-spacing': ['error', {after: true, before: true}],
'linebreak-style': ['error', 'unix'],
'lines-around-comment': 'error',
'max-depth': 'error',
'max-len': 'off',
'max-lines': 'off',
'max-nested-callbacks': 'error',
'max-params': ['error', {max: 4}],
'max-statements': 'off',
'max-statements-per-line': 'off',
'multiline-ternary': 'off',
'new-cap': 'error',
'new-parens': 'error',
'newline-after-var': 'off',
'newline-before-return': 'error',
'newline-per-chained-call': 'error',
'no-alert': 'error',
'no-array-constructor': 'error',
'no-bitwise': 'error',
'no-caller': 'error',
'no-catch-shadow': 'error',
'no-confusing-arrow': 'error',
'no-continue': 'error',
'no-div-regex': 'error',
'no-duplicate-imports': 'error',
'no-else-return': 'off',
'no-empty-function': 'error',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-label': 'error',
'no-extra-parens': 'error',
'no-floating-decimal': 'error',
'no-global-assign': 'error',
'no-implicit-coercion': 'error',
'no-implicit-globals': 'off',
'no-implied-eval': 'error',
'no-inline-comments': 'off',
'no-invalid-this': 'error',
'no-iterator': 'error',
'no-label-var': 'error',
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-lonely-if': 'error',
'no-loop-func': 'error',
'no-mixed-operators': 'error',
'no-mixed-requires': 'error',
'no-multi-spaces': 'off',
'no-multi-str': 'error',
'no-negated-condition': 'error',
'no-nested-ternary': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-object': 'error',
'no-new-require': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-param-reassign': 'error',
'no-path-concat': 'error',
'no-plusplus': 'error',
'no-process-exit': 'error',
'no-proto': 'error',
'no-prototype-builtins': 'error',
'no-restricted-globals': 'error',
'no-restricted-imports': 'error',
'no-restricted-modules': 'error',
'no-restricted-syntax': 'error',
'no-return-assign': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-shadow-restricted-names': 'error',
'no-spaced-func': 'error',
'no-tabs': 'error',
'no-template-curly-in-string': 'error',
'no-ternary': 'off',
'no-throw-literal': 'off',
'no-trailing-spaces': 'error',
'no-undef-init': 'error',
'no-undefined': 'error',
'no-underscore-dangle': 'error',
'no-unmodified-loop-condition': 'error',
'no-unneeded-ternary': 'error',
'no-unsafe-negation': 'error',
'no-unused-expressions': 'error',
'no-use-before-define': 'error',
'no-useless-call': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-constructor': 'error',
'no-useless-escape': 'error',
'no-useless-rename': 'error',
'no-var': 'off',
'no-void': 'error',
'no-warning-comments': 'off',
'no-whitespace-before-property': 'error',
'no-with': 'error',
'object-curly-spacing': 'error',
'object-property-newline': 'error',
'object-shorthand': 'off',
'one-var': 'off',
'one-var-declaration-per-line': 'error',
'operator-assignment': 'error',
'operator-linebreak': 'error',
'padded-blocks': 'off',
'prefer-reflect': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'quote-props': 'off',
quotes: ['error', 'single'],
radix: 'error',
'rest-spread-spacing': 'error',
semi: 'error',
'semi-spacing': 'error',
'sort-imports': 'error',
'sort-vars': 'error',
'space-before-blocks': 'error',
'space-before-function-paren': 'off',
'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'spaced-comment': ['error', 'always'],
strict: ['error', 'never'],
'symbol-description': 'error',
'template-curly-spacing': 'error',
'unicode-bom': ['error', 'never'],
'vars-on-top': 'off',
'wrap-iife': 'error',
'wrap-regex': 'error',
'yield-star-spacing': 'error',
yoda: ['error', 'never']
}
}
];
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ module.exports = function(version) {

if (!instructions[language][version][type]) {
// Log for debugging
console.log('Encountered unknown instruction type: ' + type); // eslint-disable-line no-console
console.log('Encountered unknown instruction type: ' + type);
// OSRM specification assumes turn types can be added without
// major version changes. Unknown types are to be treated as
// type `turn` by clients
Expand Down
Loading
Loading