Skip to content

Typescript? #68

Closed
Closed
@abalmos

Description

@abalmos

I hope this isn't too much noise--I'm having some trouble stitching together Svelte Typescript support and I can not tell if it is a configuration issue or if I'm just ahead of support. Should this plugin be compatible with Typescript?

I've tried the below eslintrc.js (and others). It appears eslint is still trying to parse the <script lang="ts> block with a Javascript parser.

>>module.exports = {                                                               
    root: true,                                                                    
    parser: '@typescript-eslint/parser',                                           
    parserOptions: {                                                               
      ecmaVersion: 2018,                                                           
    },                                                                           
    env: {                                                                         
      node: true,                                                                  
    },                                                                             
    plugins: ['svelte3', '@typescript-eslint'],                                    
    extends: ['eslint:recommended'],                                               
    overrides: [                                                                   
      {                                                                            
        files: ['*.svelte'],                                                       
        processor: 'svelte3/svelte3',                                              
      },                                                                           
      {                                                                            
        files: ['**/*.ts', '**/*.svelte'],                                         
        env: {                                                                     
          node: false,                                                             
          es6: true,                                                               
        },                                                                         
        extends: [                                                                 
          'plugin:@typescript-eslint/eslint-recommended',                          
          'plugin:@typescript-eslint/recommended',                                 
        ],                                                                         
      },                                                                           
    ],                                                                             
  };     

If support is not ready, do you have an pointers on how I might try and contribute that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions